- Home /
How Can I Get The Camara To Face Down?
Rotation is extremely difficult to grasp in unity. There seem to be four values, and none of them make any sense when you enter in the values you want. I see x, y, z and w. I have no idea how these mean anything for rotation, as they certainly are not measured in degrees. All I want is to understand what all these values mean, what units rotation is measured in and how to set up an orthographic camera that looks down on the scene.
Answer by mikelortega · Jan 08, 2016 at 08:28 AM
Unity uses Quaternions to represent rotations internally. You should not try to understand the numbers inside a Quaternion, they are not intuitive.
But, Quaternions can easily be converted to Euler rotations with Quaternion.eulerAngles, which are easier to understand. You can also convert an Euler rotation to a quaternion with Quaternion.Euler(x, y, z).
Another option is to rotate your object relatively to it's former rotation with Transform.Rotate
You should try setting the camera the way you want in the editor before writing any code.
Answer by tanoshimi · Jan 08, 2016 at 08:54 AM
If you're seeing x,y,z,w in the inspector, you're in Debug mode. These are quaternion values - a common way to represent rotations in 3d space. Turn off Debug mode to see x, y, z Euler angle values instead.
To answer your question in code:
Camera.main.transform.forward = Vector3.down;
Your answer
Follow this Question
Related Questions
Jittering effect when moving character and camera 2 Answers
how can a camera zoom into a game object? 3 Answers
Lerp Rotation broken 1 Answer
fixed rotation around object 1 Answer