[BUG 4.7.2] Timeline play call in function

I have a timeline on the event graph that will play just fine if called from the event graph. By called I mean getting a reference to the timeline then choosing Play(). This only seems to work from the event graph. If I call TimeLine->Play() from a function it does not play, however TimeLine->Reverse() called from a function seems to work just fine.
Its easy enough to create a workaround with a custom event but I wanted to bring some attention this “bug” if you want to call it that.
I understand the limitation of latent nodes not available to functions but that doesn’t make sense that only Reverse works.

Hi OpticalShadows,

Functions can’t support latent nodes, as you stated, but you can call Play on a Timeline that exists in your Event Graph from inside a function and it shouldn’t cause problems so long as you remember that it’s only calling the Timeline and won’t wait for the Timeline to finish before continuing with the rest of the function. In this case, using Play with the target as your Timeline should work just as well as Reverse. Can you show me an image of the situation in which calling Play in a function is not working for you? Thanks!

Hi Ben,

I’m having problems with this as well. In my Event Graph I have 4 timelines which I’m trying to trigger from within a function in the same blueprint. I can call Play on them just fine from another node in the Event Graph but not from the function. Here’s how it looks:

EDIT: Reverse seems to work just fine.

Hi mihai.dbpx,

It looks like your Timelines aren’t hooked up to anything. Try creating a custom event for each. You don’t need to call the event, but if the Timeline isn’t attached to anything it shouldn’t ever run.

Hi Ben,

Thanks for your reply.

I thought they didn’t have to be hooked to something to be able to be called from another place, and Reverse works with them as above. I think it would be good if they would be callable without having them hooked.
I added custom events to call them as I needed in the end.

I’m not certain why Reverse would work, and I haven’t been able to reproduce that. I’ll keep looking into it and see if something needs to be fixed. Thanks!

Hi Ben,

I would be interested for the reason, why the timeline node has to be connected to a custom event, even if the event is never called.

Is it, because the blueprint compiler (optimizer) ignores any nodes in the event graph not connected to any event nodes?

That’s correct. A Timeline doesn’t act like a function or event that can be called, as much as it may seem like one. Instead, if you want to actually use it, you need to have it in an event graph somewhere connected to an executable node, like a custom event.

Just FYI, this behavior is oddly intermittent. In a previous UE4 version I was calling Play From Start from a function targeting a Timeline in my Event Graphthat was not hooked up to anything, and it was working as expected. After updating to4.8.2that legacy wiring was still working but I could not repeat the functionality with a newTimelineand function call. TriggeringPlay From Start` with a custom event works as Ben described in every case.

Hi Ben, this behavior of timelines was introduced recently enough (4.7 or 4.8), it broke some parts of my project that have been functional for a long while.

I haven’t checked in older versions, but yes, it’s possible this was cleaned up in newer versions. It isn’t supposed to be possible to run or access Timelines that are not connected to an Event in some way.