how to make a max number on counter.

I have a program that counts guesses, but it’s just supposed to go to 20. But now it goes on forever, have can I make it max out at twenty. Thank in advance :slight_smile:

You can clamp a value between a minimum and maximum number:

Mathf.Clamp(guesses, 0, 20)

My guess is what you really want to do is to make something else happen when you reach 20 guesses.

if(guesses == 20) {

For more on conditionals check out the Unity tutorials, they’re quite good!