Hello! I was making a script and I want the camera to rotate around a moving object. So I writen this:
var heli: Transform;
function FixedUpdate(){
if(Input.GetAxis("Mouse X")<0){
transform.RotateAround(heli.position, Vector3.up, 90 * Time.deltaTime);
}
if(Input.GetAxis("Mouse X")>0){
transform.RotateAround(heli.position, Vector3.up, -90 * Time.deltaTime);
}
if(Input.GetAxis("Mouse Y")>0){
transform.RotateAround(heli.position, Vector3.left, -90 * Time.deltaTime);
}
if(Input.GetAxis("Mouse Y")<0){
transform.RotateAround(heli.position, Vector3.left, 90 * Time.deltaTime);
}
}
It works fine with the x axis, but with the y axis doesn’t. I think because I have the wrong axis, but witch is the “correct” one?
Please Help me!
P.S.: I found a nice title, didn’t I?