I am trying to get an object to rotate on the Y axis in world space. The issue seems to be that the object rotates fine (maybe on its local axis), but the global rotation is unchanged. Can someone point out where I am going wrong here?
function Update () {
if (inputLeft) {
transform.Rotate(Vector3.up, -rotateSpeed * Time.deltaTime, Space.World);
}
}
The code above gives me this :

You may confused.
For a car you would want a local rotation, this way it stays forward facing.
Either that, or the script is perhaps on a child object of the car when it should be on the top-most object?
It’s hard to tell really, but I would say experiment with using localRotation, or just omitting that Space.World.
There are only two possible reasons why your gizmos keep the world space direction:
- Because like alucardj said you have set the gizmos to global instead of local. However that won’t influence transform.forward
- This script is attached to a child object (which is rotating) but you have selected the parent object which of course isn’t rotated.
Make sure your controlling scripts (rotation / movement) are attached to the top most object and not to some child object.