If I have Start State > Closed, the gameobject is inactive, and the first time it shall play, the animator is not playing, and when you start a dialog, it just pops up, without an animation.
If I have Start State > Open, the gameobject is active, but onstart of the game, it shows the bubble. After that the animation works though.
So I made this script as a workaround, where it waits 1 second, then enables the speech bubble gameobject.
I don't know if I caused this myself somehow, but I haven't found a way around it without this script.
Code: Select all
public class DialogueActorInitNPC : MonoBehaviour {
public GameObject speechBubbleGameObject;
private void OnEnable() {
StartCoroutine(nameof(ActivateDelay));
}
IEnumerator ActivateDelay() {
yield return new WaitForSeconds(1);
speechBubbleGameObject = GetComponent<DialogueActor>().standardDialogueUISettings.customSubtitlePanel.transform.gameObject;
speechBubbleGameObject.SetActive(true);
}
}