Body is spinning around when head looks upwards
Hi,
I've never seen this issue or any solutions but when I was following this video https://www.youtube.com/watch?v=MYOjQICbd8I&t=640s to get a vr head going, it does this weird thing I can't seem to fix no matter the setting or the model I use. The head follows the view of the camera but when you look upwards to a certain degree the whole torso flips around, even though the arms indicate they're still on the other side. I'm new to VR, but this has been plaguing my project for weeks! I've tried: - editing the script - a different model - changing the offsets of the camera-head - adding/removing the constraints in the multiparent constraints - changing the constrained object to from the head to neck, top of head, eyes, etc. - changing the constraints within the model - more???
Here is my Head script: using UnityEngine;
public class Head : MonoBehaviour { [SerializeField] private Transform rootObject, followObject; [SerializeField] private Vector3 positionOffset, rotationOffset, headBodyOffset;
private void LateUpdate()
{
rootObject.position = transform.position + headBodyOffset;
rootObject.forward = Vector3.ProjectOnPlane(followObject.up, Vector3.up).normalized;
transform.position = followObject.TransformPoint(positionOffset);
transform.rotation = followObject.rotation * Quaternion.Euler(rotationOffset);
}
}
Please someone help with this! For some reason I've only found 2 tutorials for making a head work in VR and neither worked for me.
Thanks!!