ok im using the default character controller with the 2 mouse looks how do i get the spine bone to rotate on the x axis according to the angle of the camera up and down?
also would this interfere with animations?
here is what i have tried but it dosent work is their something i am doing wrong?
using UnityEngine;
using System.Collections;
public class aimupanddown : MonoBehaviour {
public Transform spineBone;
// Use this for initialization
void Start () {
spineBone = GetComponentsInChildren("spine");
}
// Update is called once per frame
void Update () {
float xRot = Camera.main.transform.localEulerAngles.x;
spineBone.transform.localEulerAngles = new Vector3(xRot,0,0);
}
}