diff --git a/Runtime/HumanoidFree/Scripts/Targets/HeadTarget.cs b/Runtime/HumanoidFree/Scripts/Targets/HeadTarget.cs index 9b56d0f..9034598 100644 --- a/Runtime/HumanoidFree/Scripts/Targets/HeadTarget.cs +++ b/Runtime/HumanoidFree/Scripts/Targets/HeadTarget.cs @@ -1130,7 +1130,12 @@ namespace Passer.Humanoid { // With ChangeAvatar, the bone may be at a different height than wat setup in the scene // Therfore we need to use the target here // I don't understand myself here. Using bone again - Vector3 worldHeadEyeDelta = eyePosition - head.bone.transform.position; + Vector3 worldHeadEyeDelta; + if (neck.bone.transform != null) + worldHeadEyeDelta = eyePosition - head.bone.transform.position; + else + worldHeadEyeDelta = eyePosition - head.target.transform.position; + Vector3 localHeadEyeDelta = Quaternion.AngleAxis(-head.target.transform.eulerAngles.y, Vector3.up) * worldHeadEyeDelta; return localHeadEyeDelta; }