Hi. I have a problem because i want to move a rigidbody in his x axis direction but it is moved always in the x axis of the world.
How can i do?
Hi. I have a problem because i want to move a rigidbody in his x axis direction but it is moved always in the x axis of the world.
How can i do?
Unity - Scripting API: Transform.TransformDirection lets you move relative to your object
Or, to put it differently, you can do this:
rigidbody.velocity = transform.right * magnitude;
Ok, thanks, finally i used translate to do it. It works with Space.Self to take local axis too.