Page 1 of 2

Unity Timeline Waiting For Player Input

Posted: Fri Aug 06, 2021 4:48 pm
by RetroVertigo
I have more questions for the Unity Timeline and Dialogue System, but I thought I would start a new thread, as my previous thread just kept snowballing.

I have my timeline setup, but I want to wait for player input before progressing through it. I believe this can be done with the Dialogue timeline/cutscene system, but I am not sure on the built in Unity Timeline system. Through some google search/testing I have put together the following:

Timeline progresses and textbox appears
Timeline is paused via a Signal Emitter and Cutscene Manager Script (custom script)
Code built into Cutscene Manager script can "unpause" timeline / set speed to 1

My question - is there an easy way for dialogue system to send a signal / var change or something to my custom script to tell it to move forward with the timeline, and also close out the dialog box?

I also have confusion on how I should be setting up my cutscene dialogue Conversations. I would like to have a whole cutscene within one conversation, but if I do that how can I have Unity Timeline setup so the conversations start/stop inbetween timeline animations, etc.

As always, any input/advice on this is greatly appreciated

Thanks
Retro

Re: Unity Timeline Waiting For Player Input

Posted: Fri Aug 06, 2021 5:14 pm
by Tony Li
Hi,

This post explains how to pause the timeline while waiting for the player to click the dialogue UI's continue button, or to wait for some other event such as the end of the typewriter effect.

Re: Unity Timeline Waiting For Player Input

Posted: Fri Aug 06, 2021 6:02 pm
by RetroVertigo
Thanks Tony
I am reading through that post, and I have a few questions, again, sorry for my ignorance on this.

-Don't use continue buttons in the traditional way. Leave the subtitle panel's Continue Button field unassigned.

For this one, I am on the Bubble Standard UI Subtitle Panel, and I have an object with sprite to show a down arrow for the Continue Button. You are saying I need to have this blank, correct? So if I use the method you describe, can I not have a down arrow showing for continue?

-Give your subtitle panel and continue button unique names. For example, name the continue button "Resume Button". Configure its OnClick() event to do two things:

I cannot find where this is, and I am not sure how to give them unique names. I am assuming that if I find these, there is an area in the inspector that shows OnClick() where I can add the Speed = 1 and Close(), correct?

-Change the entries' Sequence to:

Code: Select all


SetActive(Resume Button, false); // Hide Resume button
Timeline(speed, nameOfTimeline, 0); // Pause timeline (use speed to pause)
SetActive(Resume Button, true)@Message(Typed) // Show Resume Button upon special message 'Typed'
I am also not sure where to add this code within the inspector, or do I need this in a custom script?

Thanks again for all your help on this stuff.

Re: Unity Timeline Waiting For Player Input

Posted: Fri Aug 06, 2021 8:37 pm
by Tony Li
Hi,

In your description:

Timeline progresses and textbox appears
Timeline is paused via a Signal Emitter and Cutscene Manager Script (custom script)
Code built into Cutscene Manager script can "unpause" timeline / set speed to 1


Does "textbox appears" refer to the Bubble Standard UI Subtitle Panel?

In regard to this: "Code built into Cutscene Manager script can "unpause" timeline", what event or activity should tell the Cutscene Manager to unpause the timeline?

Re: Unity Timeline Waiting For Player Input

Posted: Fri Aug 06, 2021 9:06 pm
by RetroVertigo
Tony Li wrote: Fri Aug 06, 2021 8:37 pm Hi,

Does "textbox appears" refer to the Bubble Standard UI Subtitle Panel?
Yes, that is correct.
Tony Li wrote: Fri Aug 06, 2021 8:37 pm
In regard to this: "Code built into Cutscene Manager script can "unpause" timeline", what event or activity should tell the Cutscene Manager to unpause the timeline?
That is what I am having trouble with. I am not sure what I can do with Dialogue System to send the function to my custom script (CutsceneManager) to unpause the playableDirector. Is there something I can add to either the Conversation text or that will send that function or change a flag or something in my custom script to do that?

Re: Unity Timeline Waiting For Player Input

Posted: Fri Aug 06, 2021 10:08 pm
by Tony Li
RetroVertigo wrote: Fri Aug 06, 2021 9:06 pm
Tony Li wrote: Fri Aug 06, 2021 8:37 pmIn regard to this: "Code built into Cutscene Manager script can "unpause" timeline", what event or activity should tell the Cutscene Manager to unpause the timeline?
That is what I am having trouble with. I am not sure what I can do with Dialogue System to send the function to my custom script (CutsceneManager) to unpause the playableDirector. Is there something I can add to either the Conversation text or that will send that function or change a flag or something in my custom script to do that?
There are a lot of things you can do in the Dialogue System. I'm trying to understand what you want to happen? Should the timeline resume based on specific player input, such as clicking a continue button? Or after interacting with some UI that isn't part of the Dialogue System? Or something else?

(I've finished work for the night, but I'll check back in the morning.)

Re: Unity Timeline Waiting For Player Input

Posted: Sat Aug 07, 2021 6:53 am
by RetroVertigo
Hey Tony
Sorry I am not being clear about this, let me try again.

I have the Unity Timeline pause when a textbox appears. The Pause sets the Timeline speed to 0.

What I am looking to have happen is that, once a player presses the "south" button on the controller, the textbox will close. and the timeline speed will go to 1. I also would like to have the cutscene be within one conversation node that I could have linked, which would be easy to write out and keep track of for development of my game.

Does that make sense? I already have a function created that sets my Timeline speed back to 1, but I am not sure how I can get the Dialogue System to start this function when the player presses the south or continue button on the controller.

Re: Unity Timeline Waiting For Player Input

Posted: Sat Aug 07, 2021 8:58 am
by Tony Li
Hi,

In that case, configure the continue button as normal to continue the conversation. But additionally configure the continue button's OnClick() event to call your function to set the timeline speed back to 1.

Re: Unity Timeline Waiting For Player Input

Posted: Sat Aug 07, 2021 1:27 pm
by RetroVertigo
OK
After searching around and testing, I finally got it the timeline to continue how I need it to, but I am running into some aspects of the dialogue boxes that are odd.

Here is the first pause, which has a Start Conversation block, and the Timeline pauses with the Signal Emitter.

Image

Once I push the continue button on the controller, the timeline moves forward, BUT, the conversation goes directly to the next node. 2 things on that

1) how can I make it so the TextBox disappears and then reappears over the correct playerObject in the scene?
2) The Subtitle or TextBox (not sure what to call it) is the wrong one. It looks to be using the default textbox when I use the Continue Conversation Block for the timeline. Or, the conversation is just continuing with the wrong box/template and the Continue node/block in the Timeline is not even firing, not sure.

Image


My Conversation / Dialogue DB screen if that helps with this:
Image

Re: Unity Timeline Waiting For Player Input

Posted: Sat Aug 07, 2021 2:45 pm
by Tony Li
Hi,

Does the Thief have a bubble subtitle panel? If not, it will use the default subtitle panel.

I think I understand what you want to do now. Sorry for steering you in the wrong direction before. You don't want the continue button to continue the conversation.

1. Unassign the continue button from the subtitle panel.

2. Configure the continue button to call the subtitle panel's Close method (StandardUISubtitlePanel.Close) and unpause the timeline.

3. At the point in the timeline where you want to show the next node (Thief: "Yeah..."), add a Continue Conversation clip.