How can you hold execution until timeline finishes?

So I have an event that runs a timeline.

I then call that event from another event.

Is there a way to wait for the timeline to finish before continuing execution?

timeline inside


first phase interject happens during the timeline function
image
Interject registers, sees that timeline is not ready, sets a timer to retest itself at a set interval
image
once the timeline ends it sets it’s own bool allowing the paused function to pass once it’s interval triggers
image

Not ideal, some sort of async method would be better for performance

if you need to stack functions then you could probably make an array of strings and store the function makes in them and then call set timer by function name in succession passing in the current array iteration’s entry into the function name at the end of the timeline. This would alleviate the need for a ticking timer during the run of the timeline

Second implementation:

image

image

Just have to be sure the event name string lines up with the custom event name, otherwise it won’t trigger.

Edit:
In the second version you can also remove the “is timeline ready” bool (forgot to clean it up)

2 Likes