Question by
kejcjm9918 · May 30, 2016 at 05:21 AM ·
cameravector3fpsrotate
Unity 5 FPS Camera
Hello, I'm a student that makes FPS Game.
I make FPS Game, but I have one problem.
I applied this script to Main Camera
using UnityEngine;
using System.Collections;
public class Cameras : MonoBehaviour {
Vector3 V3;
public float TurnSpeed = 2.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
V3 = new Vector3 (-Input.GetAxis("Mouse Y"), 0, 0);
transform.Rotate(V3 * TurnSpeed);
}
}
but this script makes Main Camera rotate 360 degrees. I think I have to limit the Vectors, but I can't find it.
So, how can I limit the Vectors? Or Is there something else that better than this script?
Comment