- Home /
How can I make the player keep its momentum while airborne
So I am makinga simple 2D platformer, and I just realized that if I dont press the buttons to move, the player stops almost immediately. I dont know how to solve this issue, because I alreafy change the 2dphisics material friction to 0, and in the 2d rigidbody component I have set the linear drag to 0. Still, when I jump while moving sideways, and stop pressing the keys to move, the player stops and falls in an almost straight line to the ground.
Answer by fifthknotch · Mar 05, 2014 at 04:51 PM
Make sure you are moving your character through physics. Physics does not apply to your character if you are just changing its transform. Instead use rigidbody.addForce. This way your character will keep its previous velocity and be affected by physics.
thank you thats soved it. I was using rigidbody2D.velocity to move it now I get it thank you