From ce3fe154f1ad76d973e1a405a119c0bb157cd2b7 Mon Sep 17 00:00:00 2001 From: Yan Jin <601746725@qq.com> Date: Fri, 31 Mar 2023 15:39:07 -0700 Subject: [PATCH] CORE-2425 character will not reset after too far away. --- .../Inworld.AI/Scripts/Runtime/3DInteraction/BodyAnimation.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/Inworld.AI/Scripts/Runtime/3DInteraction/BodyAnimation.cs b/Assets/Inworld.AI/Scripts/Runtime/3DInteraction/BodyAnimation.cs index 523b0286a..adf9fcffd 100644 --- a/Assets/Inworld.AI/Scripts/Runtime/3DInteraction/BodyAnimation.cs +++ b/Assets/Inworld.AI/Scripts/Runtime/3DInteraction/BodyAnimation.cs @@ -157,6 +157,7 @@ void OnEnable() InworldController.Instance.OnCharacterChanged += OnCharacterChanged; InworldController.Instance.OnStateChanged += OnStatusChanged; InworldController.Instance.OnPacketReceived += OnPacketEvents; + Animator.enabled = false; if (!Character) return; Character.OnBeginSpeaking.AddListener(OnAudioStarted); @@ -170,6 +171,7 @@ void OnDisable() InworldController.Instance.OnStateChanged -= OnStatusChanged; InworldController.Instance.OnPacketReceived -= OnPacketEvents; } + Animator.enabled = false; if (!Character) return; Character.OnBeginSpeaking.RemoveListener(OnAudioStarted); @@ -183,9 +185,11 @@ void OnCharacterChanged(InworldCharacter oldCharacter, InworldCharacter newChara if (oldCharacter == Character) { HandleMainStatus(AnimMainStatus.Goodbye); + Animator.enabled = false; } else if (newCharacter == Character) { + Animator.enabled = false; HandleMainStatus(AnimMainStatus.Hello); } }