Fixing <180° && >360° camera bug

If you noticed, when we move the camera further than the 180° initial rotating range around the X axis, the LookAt method “inverts” immediately the camera, rotating it by 180°.

In order to fix this problem, it’s better to clamp the rotation around the X axis, to do this just add this line, in the CameraStick script, after the increments of the armrotation vector due to the stick control:

2 Likes

Privacy & Terms