How can I set it so the camera can’t move below a certain y-axis value? I’m trying to make a Total War sort of camera. So I want to limit where the camera can move.
Also, I’m having an issue where the camera rotation speed stays the same, no matter what value I put it at.
Any help or tips for setting up a decent camera? Here’s what I have so far…
public float moveSpeed = 50.0f;
public float tiltSpeed = 50.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate (Vector3.right * Input.GetAxis ("Horizontal") * moveSpeed * Time.deltaTime);
transform.Translate (Vector3.forward * Input.GetAxis ("Vertical") * moveSpeed * Time.deltaTime);
transform.Rotate (Vector3.right * Input.GetAxis ("Rotate") * tiltSpeed * Time.deltaTime);
}