How do I still allow the player to fall while they're moved by BodyVelocity?

I have a roll script I made, problem is if I try to roll near a slightly taller part (not too tall though) my character doesn’t fall and instead sort of zooms while the BodyVelocity still exists
here’s an example, if the player rolls while on the spawn platform, he’ll fly briefly

this is not a problem on taller cliffs, as the player falls instantly. Only occurs on parts with not a big height difference

1 Like

bodyforce? or is that the same

This doesn’t really make much sense to me. BodyVelocity works by applying just enough force to maintain a specific velocity. If there’s gravity, it will account for that to keep the velocity straight.

So your character should still move completely horizontal when rolling off a cliff?


Also, I’m not saying that this is the problem, but next time please have consideration on whether or not what you’re using is still being supported by Roblox.


That being said, I think you should be using :ApplyImpulse instead of any sort of bodymover. It just makes more sense since you do push yourself if you try rolling IRL.

1 Like

Bodyforce still works even when deprecated, it will someday stop working but i think you should go for applyimpulse yeah

I never heard about ApplyImpulse till now
is there any way to control how fast and far it goes? all I have for now is

Root:ApplyImpulse(Root.CFrame.LookVector * 1500)

which moves the player a bit too fast

Try changing the 1500 to something smaller, that should decrease the force.

1000 moves me less but still has the same speed, do I need to rewrite the code inside of :ApplyImpulse() to something else?

Impulse is measured in joules, which is also used to measure momentum. Momentum is calculated by simply multiplying mass with velocity. Based on this, you can make the impulse a specific velocity based on the mass of the player.

Root:ApplyImpulse(Root.AssemblyMass * Root.CFrame.LookVector * SPEED)

Also, you can just repeat the impulse method and have it spread out over a couple frames if it’s too fast doing it all at once. Remember to adjust it for the deltatime though

Root:ApplyImpulse(Root.AssemblyMass * Root.CFrame.LookVector * (60*dt) * SPEED)
1 Like

I’m pretty sure BodyVelocitys have a value called MaxForce which takes in a vector3, set MaxForce to vector3.new(10000,0,10000) – setting the Y value to 0 makes it to where the bodyvelocity cant influence the y

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.