- Home /
Making an object move in the direction it's faceing.
Hello All,
i know this is a bit of a no brainer, but i am new to unity and i am trying to do a very simple flight sim, i have managed to map my joystick to give me pitch and yaw, and a couple of buttons to do roll, but i cannot for the life of me get the object (a sphere with mesh render off and a camera as its child in the middle) to fly forwards in the direction its facing, i can make it move with rigidbody.addgorce but when i turn the object it continues to more along the original axis’s and not along the new one, i am basically trying to simulate the engin in the plane.
,
Answer by Piflik · Jul 18, 2012 at 02:30 PM
When you want to move an object in local coordinates, you have to use a local vector, in the case of rigidBody.AddForce for example transform.forward. (other methods of moving objects, e.g. transform.Translate use local coordinates by default)
Your answer
![](https://koobas.hobune.stream/wayback/20220613074339im_/https://answers.unity.com/themes/thub/images/avi.jpg)