[Solved] Number Variables not working as expected

Hello I have a problem about my variables.

When the game starts the variable should make the frogo move at random, and sometimes make him visible, but after a while he just stops moving, I checked the debugger and the number is between the 1-5 like it should, but it dosen’t go back to 0 and reset the process sometimes. I also changed it so I could see him but still he dosen’t move. I need some help.

You going to need to magnify the image to see it better.

I’m not a big fan of so many wait actions and trigger once conditions, and it could be these that are causing the problem.

So, I’d suggest that you:

  1. remove the “Trigger once while true” conditions on the 6 subevents that check the Frogo_Movement value is from 0 to 5 and
  2. the events for which Frogo_movement is 1 to 5, add a first action that sets Frogo_movement to -1 (so before simulating key press or changing the opacity to 255). It’ll be reset to 0 after all the wait commands have finished.
1 Like

Thanks! That worked really well, I wouldn’t have thought of that!


1 Like