I'm new to Unity and c# but have programming experience... I have a a simple "game" in Unity that shows one sphere orbiting another. How do I allow the camera to be moved by the user in a "free look" dynamic? I want to be able to press the right mouse button and adjust the camera on two axes. I'm using Unity 5.0. Whenever I run the following Unity freezes when I press the right mouse button.
Here's the camera control script:
using UnityEngine; using System.Collections; public class CameraControl : MonoBehaviour { private float horizontalSpeed; private float verticalSpeed; void Update () { while (Input.GetMouseButtonDown(1)) { horizontalSpeed = Input.GetAxis ("Mouse Y"); verticalSpeed = Input.GetAxis ("Mouse X"); transform.Translate(verticalSpeed,horizontalSpeed,0.0f); } } }