Hey !
I need someone who is good at Mathf.Clamp to tell me the equivalent of the Mathf.Clamp statement below.
My issue is that I want to clamp two rotations, one when my character is flipped to the right, and one when my character is flipped to the left.
Here’s the clamp statement when the character is flipped to the right and IT WORKS FINE:
if(PlayerController.flippedRight)
{
angle = Mathf.Clamp (angle, -50.0f, 50.0f); //Use this if character is flipped to the right
}
Here’s the statement that I need help with, I want it to be clamped to the equivalent to the first statement.
if(PlayerController.flippedLeft)
{
angle = Mathf.Clamp (angle, -180.0f, -10.0f); //Use this if character is flipped to the right
}
The main issue is that in between the rotations I want clamped (140, -160), and Clamp only lets you set min and max.
Thanks !