Reputation: 133
I am creating a 2d game and would like to have an object move up. I don't want it to move up relative to the object, but up relative to the game coordinates. I am currently using Rigidbody.AddForce(). Does anyone know of a way to do this?
Upvotes: 1
Views: 1733
Reputation: 133
figured it out. Instead of doing Rigidbody.AddForce(transform.up);, use Rigidbody.AddForce(new Vector2(x, y));
Upvotes: 1
Reputation: 1
Do You want it to AddForce Relative to Local space or world space?, If you want it to move in local space use AddRelativeForce(..), if you want to move based on world use AddForce(..)
Upvotes: 0