I have a game object which can be rotated by the user:
public class RotatableObject : MonoBehaviour
{
private void RotateAccordingTo(Hand hand)
{
Quaternion desiredRotation = hand.CurrentRotation;
desiredRotation.y = 0;
desiredRotation.z = 0;
this.transform.localRotation = desiredRotation;
}
}
Right now, the user is able to rotate it both counter-clockwise and clockwise.
I wish to modify the code so that the object does not rotate when the user tries to turn it counter-clockwise. It rotates only when the user is turning it clockwise.
How can I achieve this effect?