I have an object with a move script and a rotate script.
The rotate script makes the 'player' rotate to face the direction he is moving in, the problem is that when the object rotates, so does his sense of 'forward', and he ends up walking backwards.
I've tried changing the 'tool handles' to global, but it's still happening.
How do i rotate the object without affecting the movement direction?
The 'tool handles' (transform gizmo) is only for you, when you place objects in the scene. It has no influence on the objects during runtime.
If you want to move an object in world coordinates, you have to refrain from using local vectors like 'transform.forward'. Also most functions work in local space by default, and in that case 'Vector3.forward' is also in local coordinates. You'd have to specify that you want to use world coordinates.
answered Jul 16 '12 at 04:18 PM