Page 1 of 1

Playing timeline on conversation end

Posted: Thu Apr 28, 2022 12:56 pm
by drorco
Hey there,

I'm trying to resume a timeline animation when a conversation ends and the conversation UI disappears, but the best result I was able to achieve, is to have the timeline animation resumed when the Typed message is sent.

What I'm doing is basically to add this command to the sequence field of the last conversation node:

Timeline(play,MayorSlideFromRight)@Message(Typed)

It's almost what I want. I want the timeline to play only when the conversation actually ended and the UI disappeared. Any ideas on how to do that?

Thanks.

Re: Playing timeline on conversation end

Posted: Thu Apr 28, 2022 3:20 pm
by Tony Li
Hi,

If you didn't need to wait for the dialogue UI to be fully hidden, you could do this, assuming you require the player to click the continue button to advance the conversation:

Code: Select all

required Timeline(play,MayorSlideFromRight)@Message(WaitForever)
If you instead use a default sequence such as "Delay({{end}})" to wait for a duration based on subtitle length instead of a continue button, you could do this:

Code: Select all

required Timeline(play,MayorSlideFromRight)@{{end}}
However, the catch with both of those is that they, like the "OnConversationEnd" event, trigger as soon as the last subtitle/response menu ends -- but before the dialogue UI's hide animation has finished, if your dialogue UI uses a hide animation.

To do something once the dialogue UI's hide animation has finished, you'll need to hook into the dialogue UI's Dialogue Panel > OnClosed() UnityEvent.

Re: Playing timeline on conversation end

Posted: Thu Apr 28, 2022 4:51 pm
by drorco
Thank you Tony!

So I tried both of the first options you've suggested, as I don't mind the timeline resuming just after the dialogue ended, but what happens now is that the dialogue just restarts, and then when it ends the second time, the timeline instantly ends.

Any idea why this happens?

If possible, I'd prefer not to hook to the Dialogue's Panel OnClosed event.

Thanks!

Re: Playing timeline on conversation end

Posted: Thu Apr 28, 2022 8:38 pm
by Tony Li
Hi,

I notice you wrote "timeline resuming." Is your intent to pause the Timeline and resume it when the conversation ends? If so, foes your timeline include any Start Conversation clips? If so, try using Timeline(speed, 0...) and Timeline(speed, 1...) instead of Timeline(stop...) and Timeline(play...). Timeline(play) or Timeline(resume) will re-run any clips at the point in the timeline where it was paused. Setting speed, on the other hand, does a proper pause.

Re: Playing timeline on conversation end

Posted: Fri Apr 29, 2022 10:26 am
by drorco
Awesome. This works. Thanks!

Re: Playing timeline on conversation end

Posted: Fri Apr 29, 2022 10:57 am
by Tony Li
Glad to help!