How can I ensure my first event finishes before moving on?

Whats happening is that the information from the first time you run the script is being overwritten by the second running. To solve this the easiest thing imo is to make all the pairs their own actor. So create a actor blueprint with a box collision and a light and the scripting. Then use a instance of that actor for each room. Then when the event is called it will be on that specific actor and wont be overwritten unless you reenter that room.

Hi there,

New day, new problem. I have a character which runs into a room, and the lights turn off. I do this by using two actors, one for the light, and one for the trigger area for that light. Upon the character overlapping the trigger, the light begins to flicker and turn off.

Now, after 20s, the light will flicker back on IF the character is no longer in the trigger area. The problem I’m having is, when my character moves in to a new room, the blueprint sequence treats that as the active light, and the progress being made on the old light is ignored. For example:

Character walks into room. Light flickers off. Character moves into next room immediately. 20s countdown has begun to turn the first light back on, but as the second light has now been turned off, the timer for that one takes over and the first one never comes back online.

My blueprint is here. I’m still pretty new to Unreal, and I really am struggling on the logic for this one. I’m used to using async in python to run similar versions of the same event alongside each other, but this is a real mind boggler.

Any help is appreciated!

What do you mean use an instance of that actor for each room? How do I do this in blueprints? I currently have a RemoteLight and a LightTrigger as two separate actors, and I can get this to work functionally. The problem is when I add another RemoteLight + LightTrigger (with different ID to the first), and it overwrites the first sequence of events with the new sequence to be played on the new actors. Thank you for your answer!

ok so imagine in the picture above that each plane (white area) is a separate room. so we will need four triggers total, one for each room. so i made a lighttrigger blueprint and dragged it into the level 4 times.

now the simplest and most reliable solution to get started with would be to use a similar thing to what you did but make it much simpler. as you will see in the picture below i started with begin overlap and checked to make sure it was the player causing the overlap. then i made a variable of the type point light (this could be any kind of actor, i used point light for simplicity), made this variable an array, and made it editable. now comes a for each loop and the logic for the lights operation.

by doing things this way when you drag the trigger into the level you can select it and populate the array with lights in your scene from the details panel. this is an easy and effective way to get the references to specific lights. also by using this method the logic for each trigger will be self contained and wont be overwritten. this should solve the issues youve been having.

heres a basic little flickering lights script thats simple, but not optimal.