Animated Portrait - Default Sequence Value
Posted: Mon Jan 27, 2020 9:58 pm
I was trying to figure out how to implement this for all conversations as the default sequence:
But I have several different subtitles at this point. I can write a custom sequence that finds the currently active subtitle like this:
But I was wondering if there's a better way? I just want the default behavior to play the talking animation and then stop it after the text is done appearing.
Code: Select all
AnimatorPlay(Talking, PC Portrait Image);
AnimatorPlay(Idle, PC Portrait Image)@Message(Typed);
Delay({{end}});
Code: Select all
GameObject dialoguePanel = GameObject.Find("Dialogue Panel");
foreach (Transform child in dialoguePanel.transform)
{
if (child.name.EndsWith("Subtitle Panel") && child.gameObject.activeSelf)
{
animator = child.gameObject.GetComponentInChildren<Animator>();
break;
}
}