- Home /
Velocity / addforce / translate, best way to move player?
What's the best way to move the player (2D)? Using translate to move the transform, adding a force to the rigidbody or adding velocity?
Answer by Freaking-Pingo · Sep 20, 2014 at 11:55 AM
This depends on the purpose of your player's movement. Applying a force or changing the velocity of a character, can at times be difficult to precisely control from a programming perspective. As an example, if you want to move exact 10 units through the x-axis, how much force are you required to add and for how long in order to reach those 10 units? However, when using physics its easier to achieve smooth movement and also you can make use of physical attributes such as drag and physic material.
In terms of character controls, I wouldn't translate the transform of the player. Instead add a rigidbody and manipulate the rigidbodies position using methods such as rigidbody.MovePosition(Vec3), because this will take collision into account opposite from transform.Translate(Vec3)