Question by
Steven_Motta · Nov 05, 2015 at 09:09 PM ·
camerarotation
Freeze camera rotation C#
I have this code:
camera.transform.Rotate (-VerticalAxis.Value 3f, HorizintalAxis.Value 3f, 0);
I have created a joystick that moves the camera with this code, theoretically the z-axis must not change, but it changes, creating a strange distorted effect.
Comment
Answer by ARKMs · Nov 06, 2015 at 07:18 AM
Quite possibly the problem is that the spin is relatively to himself, try set in World:
camera.transform.Rotate (-VerticalAxis.Value 3f, HorizintalAxis.Value 3f, 0.0f, Space.World);
Your answer
![](https://koobas.hobune.stream/wayback/20220612044035im_/https://answers.unity.com/themes/thub/images/avi.jpg)