I am trying to rotate a character, in a 2d world, to the left or right depending on which half of the screen the mouse cursor is on. My code is: if (Input.mousePosition.x >= Screen.width / 2) { zombie.transform.rotation = new Quaternion(0f, 270f, 0f, 0f); } else { zombie.transform.rotation = new Quaternion(0f, 90f, 0f, 0f); }
When it runs the character just rotates towards the back wall and stays there regardless of where the mouse is. I get the feeling there is an easy answer to this but I just can't find it. Thank you in advance!
Never? :p but in all seriousness, don't alter them unless you know what you're doing. They're not that complicated, but also definitely not straightforward. ;)
– anon73820239Yeah, I don't want to confuse people by saying that Quaternions are a 4-dimensional representation of a rotation. That's why the values don't mean angles
– anon39354029