I’m kinda embarrassed to ask this, but I can’t figure this out:
I’m moving a cube’s Z position like this: (C# code)
currentTransform.Translate (new Vector3(0f, 0f, crashSpeed * Time.deltaTime));
While I’m moving this cube over the screen like that, I want it also to rotate, like this:
currentTransform.Rotate (0, 20 * Time.deltaTime, 0, Space.World);
It rotates all right, but unfortunately it also moves in the direction it’s rotating to. I don’t want this. The cube must move in a straight line over the Z axis, while rotating. So I tried switching between Space.World and Space.Self, but this doesn’t have any effect.
What am I missing here? Help is much appreciated.
Thanks!