02-18-2014 12:13 PM
public Transform cameraObject; //I'm using a transform because I'm using the Oculus Rift for it's rotation
public Transform headBone;
void Update()
{
headBone.rotation = cameraObject.localRotation;
}
02-18-2014 12:42 PM
void LateUpdate()
{
headBone.rotation = cameraObject.rotation;
}
02-18-2014 01:01 PM
02-18-2014 08:40 PM
02-18-2014 09:31 PM
public Vector3 neckCorrectionEuler;
void LateUpdate()
{
headBone.rotation = cameraObject.rotation * Quaternion.Euler (neckCorrectionEuler);
}
02-18-2014 09:57 PM
02-18-2014 11:09 PM
09-09-2015 10:09 PM
"Tamulur" wrote:
You can correct for the different orientation when rotating the bone:
public Vector3 neckCorrectionEuler;
void LateUpdate()
{
headBone.rotation = cameraObject.rotation * Quaternion.Euler (neckCorrectionEuler);
}
During runtime, change the avatar's neckCorrectionEuler in its inspector until it looks right (for most avatars, it's something like -90, 0, 0 or so), then enter those values outside of playmode.