- Home /
Truck moves sideways when using transform.forward
unless i don't rotate my truck at the start with my script or in my scene, it will go forward however if i do rotate it, it will go sideways
Answer by K-Anator · May 10, 2019 at 08:32 PM
Protip: paste your code in your comment by using the little binary looking icon in the formatting options, alternatively if you're on a new line you can insert a code block by pressing CTRL+K.
Unfortunately I'm not entirely sure why your object is going sideways. It would seem that for whatever reason your object isn't using it's local Z axis, but instead the world's. Vector3.forward/transform.forward are positive on the z axis. If you view the object in the scene window, is it's transform actually rotating to put Z forward, or are it's local axis remaining aligned with the world?
Your answer
![](https://koobas.hobune.stream/wayback/20220612201129im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Moving game objects 2 Answers
Setting an objects angle about a local axis without localEulerAngles? 0 Answers
Adding data to a set of transforms 1 Answer