how do i make a float from 2f to 1f in a if statement

Hello I’m a copy making the game zigzag but I do not understand how this works look if (Score = 2f)
{
Score = 1f;
}

Score need to be 1 if its is 2 then i no to set it to 1

  • = sets the value of one variable equal to the value of another (assignment operator).

  • == tests whether the value of one variable equals the value of another (comparison operator).

So your code is simply:

if (Score == 2f) { Score = 1f; }