Sorry for the bad English.
I'm doing a roll script for my game,but the problem is that when the player rolls off of a platform,because of the root.Velocity, the player flies off the platform.
that's the part of the roll script
elseif input.KeyCode == Enum.KeyCode.E and humanoid:GetState() == Enum.HumanoidStateType.Running and debounce
or input.KeyCode == Enum.KeyCode.E and humanoid:GetState() == Enum.HumanoidStateType.RunningNoPhysics and debounce then
debounce = false
animTrackroll:Play()
print "now"
local Root = localPlayer.character:WaitForChild("HumanoidRootPart")
Root.Velocity = Root.Velocity + Root.CFrame.lookVector*200
if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
print "obby"
Root.Velocity = Root.CFrame.lookVector*-Root.Velocity
end
wait (0.2)
CR = true
wait(0.2)
debounce = true
CR = false
end
end)
I tried cancelling the momentum when the player is freefalling,but I think the freefalling statetype only triggers if the player jumped. I wanted to know how to detect if the player falled from a plataform,and also if there's a better way to do a rolling script,than using the Cframe.

2 comments
Your english is perfectly understandable. Don't apologise for it. :)