how to lock an axis in unity
float lockPos = 0; void Update() { transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, lockPos, lockPos); } //Whatever you set the "lockPos" to, is what the axes will lock at. //And wherever you feed back its own rotation (transform.rotation.eulerAngles.x, for instance), is a "free angle", and will not be locked.