CameraScript

This script controls the main camera's behavior. The capsule collider and rigidbody components are not mandatory, but are used to detect collisions with world objects.

Variables
Target - The target vehicle.

Mode - There are two modes for the camera behavior in relation to input.

1 - The camera rotates laterally around the vehicle in a circle based on the direction of the analog stick.

2 - The camera will rotate a certain lateral distance around the car based on how far the analog stick is pressed left or right. The camera will also look up or down based on how for the analog stick is pressed up or down. Assume an x and y axis input for the analog stick.

Pos - The current position of the camera.

0 - The camera is outside of the car in third person.

1 - The camera is on the hood (bonnet) or rear of the vehicle in local space based on the camForward and camBack variables of the vehicle's VehicleParent script.

Auto Look - Factor for how much the camera should turn to face the direction the vehicle is moving while in the hood position.

Distance - The distance the camera remains from the vehicle. Default is 9.

Boost FOV - The field of view which the camera changes to while the vehicle is boosting.

Angle - The angle at which the camera sits relative to the vehicle.

Angle 2 - The direction the camera points in relative to the vehicle.

Mode Angle - The lateral angle limit for mode 2.

Mode Angle 2 - The vertical angle limit for mode 2.

In Car Angle - The angle limit for looking around while pos is equal to 1.

[[File:Angleguide.png|thumb|left|400px|Guide for Angle and Angle 2.

Click for full size.]]

Hidden Variables
These are variables which are not visible in the inspector, yet useful for writing scripts.

delta - Delta time multiplier for events in Update.

fixedDelta - Multiplier for events in FixedUpdate.