I'm trying to make a collision script where if a puck hits the wall, it goes the opposite direction. However, it's not even doing that. Here is the script:
local touched = true
local puck = workspace.Puck.BodyVelocity.Velocity
local X = puck.X
local Y = puck.Y
local Z = puck.Z
script.Parent.Touched:Connect(function(part)
if touched then
if part.Name == "Puck" then
puck = Vector3.new(-X, Y, Z)
end
end
touched = false
wait(1)
touched = true
end)

3 comments
Try playing with body forces
did you put a clickdetector
https://developer.roblox.com/en-us/articles/BodyMover