Hi, I am trying to keep an object within its parents boundaries. So I created this script:
Vector3 Position = transform.localPosition;
if (Position.x > 0.5f)
{Position.x = 0.5f;}
print (Position.x);
In order to prevent the object from moving over the 0.5f treshold. However, the object simply doesn’t respond to this treshold.
What am I doing wrong?