I created 3 functions:
1_ control the visibility of an input layer
2_ generates objects according to the value of the variable X
3_ increments the level and defines a new one for the X variable
In the first function, I use a "wait x seconds" action to control the display time of the layer and then call the function that generates objects. After the user interacts with the game, I call the function that increments the level, and in the end, it itself calls the first function again.
My problem is that the variable seems like it never gets updated, but as soon as I disable the "wait" action in the first function, everything works perfectly. Any idea how to resolve this?