Page 1 of 1

Timeline(speed 0) pauses timeline, but not indefinitely?

Posted: Mon Apr 10, 2023 7:34 pm
by justinoaksford
Hi Tony!

The Context:
Making a Timeline cutscene that pauses at key points before proceeding to wait for the player to proceed through dialog via continue button at their own pace.

I am nesting one timeline inside of another; The "child" timeline is played in the "parent" timeline via a Control Track.

The Child timeline has:
-2 Player Animator tracks; one to control Transform, and one to change animation clips of the player sprite.

The Parent Timeline has:
-1 Control Track for the child timeline,
-1 Start Conversation Track,
-1 Play Sequence Track
-1 SceneFader track
-1 Cinemachine track
-1 Quest State track.

I use the Play Sequence Track to use the Timeline() command to set the speed to 0 and wait for a "go" message sent by the dialogue tree conversation to set it back to 1.

The Problem:
As I was building it, I used "Play on Awake" on the PlayableDirector to trigger the timeline just to quickly test behavior and design the scene. The functionality worked great.

Then when I set up the Dialogue System Trigger to evaluate Quest Conditions (If Intro Screen quest is set to "Active") and Play Sequence (Timeline(play);), and turned off "Play on Awake", the behavior changed.

The Timeline was "pausing" indefinitely as intended, waiting for the message "go" properly- but now, for no discernible reason, the timeline will appear to "pause", but only for the amount of time until the end of the timeline, and then will "end" the timeline clip. For example; if the pause occurs and there are 2.4 seconds left at the timeline's regular play speed, once it has been paused for 2.4 seconds, it will "end" the timeline as if it had reached the end of the clip.

In other words; the Timeline appears to "stop" correctly, but some part I can not see is continuing to proceed as if the speed had not changed, but without triggering any of the other track behaviors. It's as if the Timeline is paused but it's "Timer" isn't, or something.

It took me a long time to isolate that switching from "Play On Awake" to the Dialogue System trigger was the change that altered the behavior, so my only guess is that something about the way the Play Sequence works from the trigger is different from how "play on awake" on the director works? (And indeed, when I re-set it to "play on awake", it regains it's correct functionality.)

Re: Timeline(speed 0) pauses timeline, but not indefinitely?

Posted: Mon Apr 10, 2023 8:23 pm
by Tony Li
Hi,

You could probably get rid of the Play Sequence track and just use Timeline(speed) commands in the conversation. In the first node, use Timeline(speed) to set the timeline's speed to zero. In the last node, use Timeline() to set the timeline's speed back to 1.

For Timeline(play) commands, you might want to include the nowait and nostop parameters, such as:

Timeline(play, SomeTimeline, nowait, nostop)

The nowait parameter tells the command to just kick off the timeline and don't wait for it to finish; let it run on its own.

The nostop parameter tells the command to not stop the timeline; let it run on its own until it ends naturally or something else stops it.

Re: Timeline(speed 0) pauses timeline, but not indefinitely?

Posted: Tue Apr 11, 2023 11:45 am
by justinoaksford
Hi Tony!

Oh yes- I'm using nostop and nowait, etc.- mostly left them out of the post for brevity.

Unfortunately from a workflow perspective I don't think putting them in nodes will work, as what I need is spatial control over where the character "stops"- as far as I can tell, if I put all the play and pauses in the nodes, they would need fragile "delay" timers or to use signal emitters from the timeline anyways to sequence properly and not risk having the dialogue trigger\timeline freeze get out of sync with the animations. For a cutscene focused game, it feels hard to parse and hard to edit retroactively if things change.

I did find a solution though anyone else reading this may not be able to apply it to their situation; instead of using the "Play Sequence" Action from the "Dialogue Trigger" that is checking for quest status, I can use the GameObject activation action on the GameObject that has the PlayableDirector, so I can get around whatever weirdness is happening there.

Re: Timeline(speed 0) pauses timeline, but not indefinitely?

Posted: Tue Apr 11, 2023 2:21 pm
by Tony Li
That's a reasonable solution for your case.