Page 1 of 1

Animation/Video while answering

Posted: Fri Nov 25, 2022 10:52 am
by DayKnight
Hello there :)

Is there a build in feature which allows me to play videos, if player picks one answer, play this video if another play this. What I want to do is,
1. play a cutscene,
2. (Pause) (Wait for player input)
3. If player picked 1 (Play cutscene 1) else (Play cutscene 2)
4. Play next cutscene etc.

I know there is a way to do character animation while talking to an NPC, but is there an option for cutscenes like this?

Re: Animation/Video while answering

Posted: Fri Nov 25, 2022 1:47 pm
by Tony Li
Hi,

The Dialogue System uses sequences to handle stuff like this. Each dialogue entry node waits until its Sequence is done. (Or the Dialogue Manager's Default Sequence if the node's Sequence field is blank.)

For example, if your "cutscene" is an animation, you can set a node's Sequence to something like:

Code: Select all

AnimatorPlayWait(my_cutscene_animation)
or even:

Code: Select all

AnimatorPlayWait(dance)->Message(Danced);
AnimatorPlayWait(bow)@Message(Danced)->Message(Bowed);
required AnimatorPlay(idle)@Message(Bowed)
If your cutscene is a timeline:

Code: Select all

Timeline(my_timeline_gameobject)
There isn't a built-in command for video, but you can write custom sequencer commands. See the Cutscene Sequence Tutorials.