I
I
ITLDS2019-09-21 07:57:45
C++ / C#
ITLDS, 2019-09-21 07:57:45

The camera is not rotated correctly. What's wrong?

I am writing a simple game in Unity using C#. I need to implement camera rotations with the mouse, I do it like this:

transform.Rotate(-Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0, Space.World);

I move the mouse horizontally - everything is correct, I move it vertically - the camera rotates along the Z axis, not Y. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question