Page 1 of 1

Unable to control the listener's animator.

Posted: Wed Aug 18, 2021 3:26 am
by 2gold
* This article was written through a translator.
Hello, I bought and use Dialogue System Asset.
Thank you for creating a powerful and easy tool.

I made Animated Portrait, and it works well.
But there is one problem.

1. Create an NPC node in GameObject and attach the Dialogue Actor script. Next, you connected the animator to the Portrait Animator Controller entry.

2. In the Conversations section, I put the following script in the NPC's Sequence item.

Code: Select all

AnimatorPlay(Talk,Photo_NPC0);
AnimatorPlay(Idle,Photo_NPC0)@{{end}}
Now the NPC's mouth moves while the NPC's lines are being spoken, and stops when the lines are finished.

3. However, if the player's lines are played by pressing the Continue button while the NPC's mouth is moving, the NPC's mouth will not stop forever! (This is because the NPC node's animator continues to play in Talk state.)
error.gif
error.gif (240.29 KiB) Viewed 496 times
*The left character has started his lines, but the right character can't stop talking.

Is there any way to reset the state of the animator when another character starts a dialogue while the animator is playing?
I tried something like AnimatorPlay(Npc,Talk,Photo_NPC0) in the Player's Sequence, but it didn't work. :(

I hope the question is well understood.
thanks!

Re: Unable to control the listener's animator.

Posted: Wed Aug 18, 2021 10:19 am
by Tony Li
Hello,

Use the 'required' keyword:

Code: Select all

AnimatorPlay(Talk,Photo_NPC0);
required AnimatorPlay(Idle,Photo_NPC0)@{{end}}
This guarantees that AnimatorPlay(Idle,Photo_NPC0) will run.

Re: Unable to control the listener's animator.

Posted: Wed Aug 18, 2021 9:25 pm
by 2gold
I applied it to the Node before the Actor transitioned and it works great!
Thanks for your help!

Re: Unable to control the listener's animator.

Posted: Wed Aug 18, 2021 9:42 pm
by Tony Li
Glad to help!