I found a post on the forum where Max.Chen suggested using GetCurrentTime from the Level Sequence Director to get time information however this post was back in 2022 and the functionality seems broken?
(Post in question : Get Current Frame inside Level Sequence Director BP )
I have a level sequence I made in 5.3, which I’m currently testing in 5.4 (nothing critical, thus bleeding edge), which has an event track firing events to a custom event on the Level Sequence Director blueprint for my Level Sequence. Running the sequence from the Sequencer tab/window works fine and the event fires, but the GetCurrentTime values returned are always;
As noted, this is in the blueprint for the sequence, the function event was created by creating a new End Point directly from an event on the time line.
Also, adding a call to ‘GetSequence’ results an an error at runtime saying ‘no sequence player’ - I mention it just in case it matters?
Hey there, so the time here is specified in TickResolution, so you’ll need to convert that. You can do something like this to print out the frame number:
Its pointed me in the correct direction, as well as confirming I’ve found an issue 5.4 (seems when you hit recompile on the Director Blueprint for the sequence, it loses a reference to the sequencer until you close/repen the sequence), which would explain why I wasn’t having any joy above.
That’s given me something to work with now, and I’ve filled a bug for the above (" Case # 01954245: Director Blueprint loses reference to sequencer on recompile has been received", no UE number at time of replying), so hopefully in the future I won’t have to open/close the sequence constantly
Just to add to this; I did a spot of digging/debugging and I’ve found the root cause of the bug.
ULevelSequence::CreateDirectorInstance had a significant change on Jan 23rd in commit 5343109a
The biggest issue seems to be that ULevelSequenceDirector has now gained a field “WeakLinker” which is being used to look up things, such as the Sequencer, from the SharedPlaybackState which gets populated on load in the above create function.
When you hit ‘compile’ on the LevelSequenceDirector, this can/will cause a GC cycle to run; this GC cycle nulls out “WeakLinker” inside ULevelSequenceDirector so that an instance of the blueprint can, for instance, no longer look up the Sequencer being used.
Reloading the sequence asset invokes ULevelSequence::CreateDirectorInstance which fixes it up again, right up until a compile happens at which point you need to close/reopen.
Hopefully someone can pass the above findings on to the right people to investigate and fix it.
(I’ll probably look into a code work around on my end, because it really is workflow breaking, but given the size of the rewrite I doubt I’ll find a good solution myself, more like a hack if I’m lucky.)