What the most better force/velocity for dashes?

hello everyone. I was scripting a battlegrounds game and started making dashes. I used linear velocity. Everything was smooth until I found out that linear velocity doesn’t have gravity (or it does and I’m dumb). So the problem is: if you jump and use dash then you gonna levitate until dash ends

you may think: “just put a negative number for Y in the vector”, but the thing is, if player uses dash on the ground then character will go under baseplate

is there any parameter that can enable gravity for this velocity or I should use smth else for dashes?

2 Likes

Try replacing Velocity.MaxForce = 100000 with:

Velocity.ForceLimitsEnabled = true
Velocity.ForceLimitMode = Enum.ForceLimitMode.PerAxis
Velocity.MaxAxesForce = Vector3.new(100000, 0, 100000) -- Modify Y if necessary

MaxAxesForce Documentation

1 Like

hey! thank you very much! it works now. but i got a new problem: when you dash forward you go up a bit for a second.

notice that it happens only with forward dash. other ones are working perfectly

That’s interesting. Are you sure its not the animation that’s moving your character’s body upwards? I tested on a baseplate with a normal R6 rig and it didn’t jump anywhere.

2 Likes

i figured it out, it happens very random. because right now its working perfectly. idk what is the reason for this, but like i said its random

thank you very much for your help !

i will mark your previous answer as a solution

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