diff --git a/Runtime/HumanoidFree/Scripts/HumanoidControl.cs b/Runtime/HumanoidFree/Scripts/HumanoidControl.cs index 54f4c9c..08d644b 100644 --- a/Runtime/HumanoidFree/Scripts/HumanoidControl.cs +++ b/Runtime/HumanoidFree/Scripts/HumanoidControl.cs @@ -386,6 +386,8 @@ namespace Passer.Humanoid { } public void LocalChangeAvatar(GameObject avatarPrefab) { + if (avatarPrefab == null) + return; Animator animator = avatarPrefab.GetComponent(); if (animator == null || animator.avatar == null || !animator.avatar.isValid) { diff --git a/Runtime/Sites/Scripts/HumanoidInterface.cs b/Runtime/Sites/Scripts/HumanoidInterface.cs index 75ea030..bac43c1 100644 --- a/Runtime/Sites/Scripts/HumanoidInterface.cs +++ b/Runtime/Sites/Scripts/HumanoidInterface.cs @@ -112,6 +112,9 @@ namespace Passer.Humanoid { /// The GameObject of the Possession to add /// This does nothing if the gamObject is not a Possession public void TryAddToPossessions(GameObject gameObject) { + if (gameObject == null) + return; + Possessable possession = gameObject.GetComponent(); if (possession == null) return;