- Home /
How to Smooth Out Constant Velocity on Rigidbody2D
Hi, I am setting constant velocity for my character movement in my 2D game. However since using the method my character seems to be shaking a little. I was just wondering if there was a way to fix this and smooth the movement out.
Here is I set the velocity in the Update function:
constantVelocity = new Vector3 (playerInputX * speed, playerInputY * speed, 0);
I then apply this velocity in the FixedUpdate function.
If anyone can get back to me I would much appreciate the help.
Many Thanks,
Tommy Eaves
Answer by D4us · Nov 13, 2016 at 06:07 PM
@TommyEaves2002 try this
constantVelocity = Vector3.Lerp(constantVelocity ,new Vector3 (playerInputX , playerInputY , 0)* speed, 0.05f );
Your answer
Follow this Question
Related Questions
NullReferenceException: UnityEngine.Rigidbody2D.get_velocity() 0 Answers
Do rigidbodies (especially 2d) have limits on their velocities? 1 Answer
rigidbody2D velocity zero? 1 Answer
move 2d character affected by physics with velocity and/or add force 2 Answers
2D Geometry dash-like ship physics 0 Answers