so i’m trying to rotate this gameobject but don’t rotate it too much as my gameobject should stop rotating when it reaches postion.x 2.5 when i move it does work on unity editor but not
if(tiltY < 0 && playerTrasform.position.x >= 2.5f)
{
playerTrasform.transform.Rotate(0.0f, 0.0f, 0.30f);
}
if (tiltY > 0 && playerTrasform.position.x <= -2.5f)
{
playerTrasform.transform.Rotate(0.0f, 0.0f, -0.30f);
}