Question by
alsunnaryahmed · Jul 29, 2021 at 07:07 PM ·
if-statementsconditional
The first if statement works and "pads" move but it stops at position 1, why isn't working ? (pads is of type Vector3)
void padsMoving()
{
if (pads.x <= 20f)
{
pads.x -= 0.05f;
transform.position = pads;
}
if (pads.x <= 1f)
{
pads.x += 0.05f;
transform.position = pads;
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613040951im_/https://answers.unity.com/themes/thub/images/avi.jpg)