Still having issues after several rotation clamping searches

Your best bet is to have local-only float variables to represent traverse and elevation, then change and clamp those floats, and finally drive .localRotation of the parts on their correct Transform axis.

Turret aiming/rotating:

Notes on clamping rotations and NOT using .eulerAngles because of gimbal lock:

How to instantly see gimbal lock for yourself:

All about Euler angles and rotations, by StarManta:

https://starmanta.gitbooks.io/unitytipsredux/content/second-question.html

1 Like