- Home /
Can't lock rotation of object.
I have a player that moves along a path created using ITween. The player has a first person camera on him. I added an arrow onto the player and I want the arrow to point to the mouse using only the z axis. I am using ITween to rotate the arrow.
iTween.RotateTo (arrow, iTween.Hash("z", -45, "x", 0, "y", 0, "time", 1.5));
The problem is that when the player rotates to turn it rotates the arrow on the y axis. I have also tried locking it in place using
`transform.rotation = Quaternion.Euler(0,0, transform.rotation.z);`
But it doesn't work either. Any idea what is going on?
Do you mean the axis you see in the editor scene view i.e. x (red), and z(blue)?
Sorry I should have been more specific. The arrow is a 2-d sprite that is in the center of the camera during gameplay.
Your answer
Follow this Question
Related Questions
Screen.lockCursor messes my rotation 1 Answer
iTween - rotation messed up on children objects 4 Answers
iTween - Add rotation while another rotation tween is still in progress 0 Answers
Camera Scrolling just track the Charakter if z-Rotation=180 0 Answers
Locking Rotation of UI Elements Relative to Canvas (VR) 1 Answer