Sync full head rotation

This commit is contained in:
Raicuparta 2022-04-15 13:59:56 +02:00
parent 64dd596fba
commit cd9108676e

View File

@ -39,6 +39,6 @@ public class PlayerHeadRotationSync : MonoBehaviour
var bone = _attachedAnimator.GetBoneTransform(HumanBodyBones.Head);
// Get the camera's local rotation with respect to the player body
var lookLocalRotation = Quaternion.Inverse(_attachedAnimator.transform.rotation) * _lookBase.rotation;
bone.localRotation = Quaternion.Euler(0f, 0f, lookLocalRotation.eulerAngles.x);
bone.localRotation = Quaternion.Euler(lookLocalRotation.eulerAngles.y, lookLocalRotation.eulerAngles.z, lookLocalRotation.eulerAngles.x);
}
}