Download

Synchronous vs Asynchronous animations

I have make shift boxes that are a place holder for what will be our animated robots, and i am trying to figure out how to do basic animations in the blueprint for the make shift guys.

Animations like Move Forward x 1, Run in to Wall.

It is a turn based game, and the server resolves actions taken and queues up animations on the clients to be played when the server finishes resolving moves. (I don’t know if this is even the best way to do this but not the scope of this thread).

I am using timelines and custom events to play animations on the box actor now. (also not sure if this is the best way to do it)

Problem is when the event is fired, the timeline is played, and it seems to call the next animation in the array instantly.
How should i make execution wait?

I can’t simply make it a function since timelines are on the event graph only, they cannot be functions.

Thanks!
Joe

Maybe i should be using matinee?

I think that would still have the problem.
I tried adding in a “flag” boolean that doesnt exit the function (that calls the event) until the timeline finishes, but that locks up everything somehow.

Figured it out:

Events events events!

i had a foreach loop that was playing all animations in the list, where what i needed was to play the first animation, and then have an event called “play next animation” that was called on a timelines finish!

This is obviously not a robust way of playing animations, but with some extra work, and going all in with events, it can work nicely i think.

PS. I am still unclear as how execution is handled in this case, as when i had the loop, things were DEFINITELY asynchronous.