How do I Repeat an action infinitely

I tried looking for an answer but couldn’t find anything, I’m trying to have it repeat but it just does it once.

Hi there, you have it as a sub event under the cursor is on start button and then you wait a sec and then switch scenes.

The cursor touch event is different, I’m trying to have it switch on and off an effect but it doesn’t repeat it.

Thank u though

Well maybe pull it out to the left so it’s not a subevent under the nonrelated event.

buenas noches compañero. ya intentó poniendo un temporizador, lo inicializa y luego pone la condición si el temporizador es >= a cierto tiempo, de acción pone reanudar el temporizador y luego lo que necesité, así cada cierto tiempo, se va a repetir la acción

1 Like

image
This condition/event is not compatible with being part of “The cursor/touch is on startbutton”

The beginning of the scene is exclusively the first frame of the scene. It is icredibly unlikely the player’s cursor will be on the start button during that time.

Edit: Additionally, Wait events are special events that are asynchronous, they are not going to work very well with a “Repeat” event, and are basically going to build up/not work at all. Additionally, you’re also saying to turn the effect back on immediately.

If you’re wanting “enable effect” > delay 1.1 seconds > “disable effect”, You’re only going to have the effect disabled for one frame before it is enabled again.

Is that what you’re wanting? Or are you wanting the effect enabled, it waits 1.1 seconds, the effect is disabled, it waits 1.1 seconds, then the effect is enabled again?

2 Likes

Yes, Thank you both very much.

To clarify what I was trying to do was turn on and off the “glitch” effect every few seconds to make a flickering glitchy title screen.
I am still kinda new to this though.

There’s a few different ways you can do this. If you want this to happen outside of the start button being clicked, I would do this:

(Event 1) Effect "Effect2" of Background is enabled                          | Wait 1.1 seconds
Trigger once                                                                 | Enable effect "Effect 2" on Background: no

(Event 2) Effect "Effect2" of Background is enabled  (Inverted)              | Wait 1.1 seconds
Trigger once                                                                 | Enable effect "Effect 2" on Background: yes

This will give the effect 1.1 seconds of being on (since all effects are on by default at the start of the scene), then turn off. As soon as it turns off, it will wait 1.1 seconds then turn back on, and repeat infinitely. The trigger once condition is very important to ensure you’re not starting a new Wait every frame.

Thank You very much :slight_smile: