How to lock rotation through script code example
Example: unity how to lock rotation
public float lockPos;
void Update()
{
// Locks the rotation.
transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, lockPos, lockPos);
}
public float lockPos;
void Update()
{
// Locks the rotation.
transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, lockPos, lockPos);
}