diff --git a/Assets/UniGLTF/Editor/UniGLTF/Validation/HumanoidValidator.cs b/Assets/UniGLTF/Editor/UniGLTF/Validation/HumanoidValidator.cs index f95a3b422..2f65878d0 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/Validation/HumanoidValidator.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/Validation/HumanoidValidator.cs @@ -133,11 +133,11 @@ namespace UniGLTF // Func getBoneTransform = null; - if (ExportRoot.GetComponent() is UniHumanoid.Humanoid humanoid) + if (ExportRoot.TryGetComponent(out var humanoid)) { getBoneTransform = humanoid.GetBoneTransform; } - else if (ExportRoot.GetComponent() is Animator animator && animator != null) + else if (ExportRoot.TryGetComponent(out var animator)) { getBoneTransform = animator.GetBoneTransform;