“Generic Move Camera” is a utility script that allows you to move Unity’s camera around the scene. It's a really quick design for helping an author create a camera they can use to move through a scene. You could use it for a full project, but I'd recommend reimplementing it to use only the features you need.
It implements these features:
• Note: Should work in Unity 4.0 or better.
• Fully customizable; ability to change the key/mouse mapping to anything you want. Keys mention below are the script’s defaults.
• Allow more than one Generic Move Camera script in the same scene, such as local multi-player games, to use different input systems to move independent cameras or similar capabilies.
• Ability to keep the camera level.
• Ability to turn the script on/off at runtime to, for example, prevent camera movements during text inputs, etc.
• Ability to move forward or backward using to different methods; (Default w/s or scroll wheel).
• Ability to pan left or right. (Default: a/d)
• Ability to pan up or down.(Default: q/z)
• Ability to rotate the camera using the mouse. The script uses “mouse2” (by default) to allow “mouse1” for your actions, but you can use either.
• Ability to fix the camera on another object and specify the zoom in/out ranges.
• Ability to specify the zoom range while locked on another object.
• Ability to freeze the movement. (Default: “space”)
• Ability to lock the camera’s X, Y or Z to any point or within a given range.
• Use dampening to slow movement down before stopping.
• Ability to specify different sensitivities to move faster or slower depending on scene size.
• Comes with a default key/mouse mapping using Unity’s input system, but can be replaced by any input system of your choice. All you need to do is set various bool or vector2’s through a call at the start of the update system.
• Manually call the camera movements to have additional automation.
• v1.3 Added (Jan 2018) "Level Camera Angle Threshold" to prevent the camera from spinning wildly when "level camera" is ON, and the camera is pointing vertical.