Setting Y velocity after falling off of a part

I made a StarterCharacterScript that sets your Y velocity to 100 once you’re no longer standing on a part. For some reason, it just makes you slow down one time shortly after being in the air, then doesn’t do anything else.

while true do
	repeat wait() until script.Parent.Humanoid.FloorMaterial == Enum.Material.Air
	script.Parent.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0, 100, 0)
	repeat wait() until script.Parent.Humanoid.FloorMaterial == Enum.Material.Air == false
end

Here’s a recording of what happens:
glitch.wmv (447.5 KB)
Why doesn’t it bounce my character upwards after I walk off of the stairs?

2 Likes

robloxapp-20220805-0330540.wmv (1.5 MB)

I got the bouncing affect by doing:

while true do
repeat task.wait() until script.Parent.Humanoid.FloorMaterial == Enum.Material.Air

script.Parent.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0, 100, 0)

repeat task.wait() until script.Parent.Humanoid.FloorMaterial ~= Enum.Material.Air

end
1 Like