Answer the question
In order to leave comments, you need to log in
How to make camera rotation in unity3d?
Good day
unity3d I'm studying recently and the question arose
How to make the camera rotate from a third person?
for clarity, I want to do it like here solarsystemscope.com
so that you can rotate around the object
along the X axis, it rotates normally,
but if I start rotating along the Y axis, I get chaos
of information about this, I could not find it because I don’t know what this type of camera is called correctly
if (Input.GetKey (KeyCode.D)) {
transform.RotateAround (new Vector3 (0, 0, 0), new Vector3 (0, -2, 0), 100 * Time.deltaTime);
}
if (Input.GetKey (KeyCode.A)) {
transform.RotateAround (new Vector3 (0, 0, 0), new Vector3 (0, 2, 0), 100 * Time.deltaTime);
}
if (Input.GetKey (KeyCode.W)) {
transform.RotateAround (new Vector3 (0, 0, 0), new Vector3 (2, 0, 0), 100 * Time.deltaTime);
}
if (Input.GetKey (KeyCode.S)) {
transform.RotateAround (new Vector3 (0, 0, 0), new Vector3 (-2, 0, 0), 100 * Time.deltaTime);
}
Answer the question
In order to leave comments, you need to log in
Insert a rotateY container, and insert a camera into its rotateX and rotateX , then rotate rotateY along the Y axis, and the other, respectively.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question