- Home /
Keep Horizontal Momentum after Jump
Hi,
I am trying to create a 3D FPS-character-controller and came across something inconvenient: the collision, which happens when the player hits the ground after a jump, seems to reset the player (rigidbody) velocity to zero, instead of just setting the Y-component to zero.
Since I am using acceleration and don't let the player reach max speed instantly, this is very noticable and annoying.
Anybody has an idea, what I could do to mitigate this?
Answer by LexGear · Jul 02, 2020 at 04:36 AM
So, if I understand you correctly. What you are saying is that when your player jumps, and then hits the ground, if the player was moving forward it then suddenly stops and it has to gather momentum again? If that's the case it might just be simple physics, because coming into contact with the ground does slow forward momentum. In that instance, you might need to adjust your players weight and drag on the ridgidbody.
Alternatively, if the player stops moving forward right after you hit space, then the issue is with how you are applying your force.
Answer by thalesdarini · Aug 30, 2021 at 11:53 PM
I was having a similar problem with a 2D platformer and it was because of friction. Try adding a Physics Material to your RigidBody and setting the Friction to 0 (guess it's the Dynamic Friction for 3D in your case). The material can be created under the menu Create > Physic Material.
Thats indeed how I solved it in the end, but it had implications on the rest of the movement, IIRC.
Your answer
Follow this Question
Related Questions
How can I make a physics object jump a given height on collision regardless of current velocity? 1 Answer
Collisions causing Rigidbody to go Haywire and move randomly. 1 Answer
Issues Making Character Move With Rigidbody 1 Answer
Interpolate problem? Jump isn't smooth... 1 Answer
Simple Movement Game: Physics vs Manual Collision Detection? 2 Answers