How do I restart an event?

I want that after the last action of an event, this one restart and go back at the first action.

In the game I’m developing, the main menu has one sprite with 4 animations that have 4 frames each one, first the first animation starts in his first frame, next the second animation and it goes like that until the last one. I don’t know how to make that after the last frame of the last animation, all the event repeats himself, so the sprite plays the fist animation in the first frame and repeats all the sequence.

The animation sequence works correctly until the last action, and after that, stops, and that’s all.


(the image looks so small because the event is very big, I want that after the very last “wait RandomInRange(2, 4.2) seconds”, the first "change the animation of AnimMenu: set to “Baby default” plays again)

1 Like

Add condition
Boolean variable Resetter is FALSE

In 1st action on top add Change boolean variable Resetter set to TRUE

And in last action add change boolean variable Resetter set to FALSE

1 Like

Cant he use the repeat condition?

Wasn’t it repeat X times?

Also now i wonder if just with last action changing animation to 1st animation would not do the trick

Then all would be needed is condition
Animation of object = Name of 1st animation
Or by index 0

Wait a sec now i have better idea

There is expression OBJECT.Animation::Index()
Which returns in which animation your object is

You could just event like
Condition
SOME BOOLEAN variable = False
COMPARE TWO NUMBERS (is the name of condition below)
AnimMenu.Animation::Index() = HERE PUT MAX index of your animations
Trigger once

Action
Change animation (by index) of AnimMenu SET TO 0

Condition
AnimMenu animation is finished
SOME BOOLEAN variable = False
Trigger once

Action
Change SOME BOOLEAN variable = True
Change animation of AnimMenu Add 1
Wait random whatever you need to wait here

IF you for example have 10 animations then since 1st will start from 0 last will be 9 and not 10 so index of last is 9
This you put in compare 2 numbers

1 Like