Random Variable + no movement

A variable randomly sets value to 0 or 1 every 1 seconds.
When variable = 0, move sideways right 0.02
When variable = 1, move sideways left 0.02

A sprite in the screens center moves right for 1 second, then stops moving.

I tried adding,WHEN SYSTEM-RUNTIME-EVERY FRAME before the “When variable = 0, move sideways right 0.02”
This didn’t work.

What do i code so the sprite always moves right if the variable = 0?
and if variable = 1 move left?

@Ready

1 Like

Hi @Suzzy-Grey!
“A variable randomly sets value to 0 or 1 every 1 seconds.” - Try use repeat every 2 sec.
The bottom line is that the value “Repeat every”, should always be greater than the maximum value of the variable. (Such a specificity of the work of the program code, the values should not be the same).

2 Likes

Thanks for the info.
I wasn’t aware of that QUIRK :slight_smile:
I’ll try that out and see what happens

1 Like

The project for example: https://ready.app.link/H3yamrPOLP

1 Like