- Home /
Should I move an object using Transform.translate, or by changing the velocity of the Rigidbody with a Vector2/3 each frame?
I've seen both; in one example, somebody moved a bullet forward by translating the bullets Transform forward each frame:
transform.Translate(Vector3.forward * speed * Time.deltaTime);
And I've seen people move a character in a Move method by accessing the Rigidbody of the player and changing the velocity using a Vector2 (or Vector3):
playerRigidbody.velocity = new Vector2 (move * maxSpeed, playerRigidbody.velocity.y);
Are there specific situations in which I would prefer one method over the other? Or is one of these methods simply more efficient/elegant way over the other? Or are both of these methods equally fine?
Comment