GIF of my issue.
I just don't understand why it wants to push the player into the air instead parallel to the baseplate's surface.
Any advice about where I went wrong would be great!
Here is the code I used for the circular pushing block:
local pusher = script.Parent
function handleTouch(otherPart)
if not buttonPressed then
buttonPressed = true
character = otherPart.Parent
humanoid = character:FindFirstChild('Humanoid')
local t = character:FindFirstChild("Torso")
if humanoid and character.Name ~= script.Parent.Parent.Name then
print("Found".. t.Name)
wait()
v = game.Lighting.BodyVelocity:Clone()
v.Parent = character.Torso
v.Velocity = Vector3.new(0,0,0)
v.Script.Disabled = false
wait()
v.Velocity = (script.Parent.Position - t.Position).unit*-250 --pushes the pushee in the opposite direction of the pusher
end
wait()
buttonPressed = false
end
end
pusher.Touched:connect(handleTouch)
