- Home /
Inconsistent Rigidbody2D velocity.
I'm not sure where I'm going wrong but I set:
rigidbody2D.velocity = moveDir * GetComponent().speed * 60.0f* Time.deltaTime;
It works fine when I run the game, but if I focus on the player object in the editor while running the game, the player starts moving twice as fast until I unfocus from it... Any ideas?
I don't think u need to use the "* Time.deltaTime" there.
I agree with @Vitor_r, you don't want Time.deltaTime. In addition, make sure that moveDir is normalized.
Your answer
Follow this Question
Related Questions
AddForce vs Velocity issues with Rigidbody2D 2 Answers
Velocity Movement & Physics Interactions by Rigidbody2D 0 Answers
Is there a solution to when colliders bypass? 2 Answers
HingeJoint with no rotation? 0 Answers
How do I keep objects with Rigidbody from moving slightly after they stopped? 1 Answer