Getting the OVR transform to mechanim?
I understand that for mechanim, I'll need to use the Animator.SetLookAtPosition in order to move a character's head/neck; but how do I go about linking the vector3 that it needs to the OVRCamera's camera.transform.rotation?
So far, my code is as follows:
So far, my code is as follows:
using UnityEngine;
using System;
using System.Collections;
[RequireComponent(typeof(Animator))]
public class playerIK : MonoBehaviour {
Animator animator;
[HideInInspector]
public Transform target;
void onAnimatorIK (){
Vector3 target = OVRCamera.NeckPosition; <---- this does not work, at all :(
animator.SetLookAtPosition (target);
animator.SetLookAtWeight(1.0f);
}
void Start ()
{
Animator = GetComponent<Animator>();
}
}
