{{{ #!Markdown # CameraControl Controls the main camera of the scene, providing different views and camera options. The main camera is a GameObject at the top level of the scene containing a Camera component. You can configure the camera's parameters as usual. The script expects the following components to be also present: >CamSmoothFollow CamMouseOrbit CamSmoothLookAt CamFreeView CamFixTo CamSmoothLookAtPointFromPos These scripts provide the camera modes. They are controlled from CameraControl. Note that some of them are scripts from the Standard Assets with specific adjustments and modifications. #### Camera modes CameraControl provides six different camera modes, which are invoked from [CarMain](wiki:CarMain) through the public functions _Next_ and _SwitchTo_: __0 -__ Driver's View (_CamFixTo_) __1 -__ Follow Vehicle (_CamSmoothFollow_) __2 -__ Mouse View (_CamMouseOrbit_) __3 -__ Static Position (_CamSmoothLookAt_) __4 -__ Free Camera (_CamFreeView_) __5 -__ Vehicle To Vehicle (_CamSmoothLookAtPointFromPos_) In the [live demo][] you can use the keys C or F1-F6 to select the camera mode. Press H for help on further keys that controls the camera's movement and zoom. ## CameraControl parameters The [CarMain](wiki:CarMain) script controls most of these parameters according to the user's input. __Target__: reference to the vehicle that is being followed. __It must contain a [CarCameras](wiki:CarCameras) component.__ __Target2__: optional reference to a secondary vehicle to be used in the _Vehicle to vehicle_ mode. __MapCamera__: optional reference to a camera showing a mini map. This camera is an orthographic camera with a SmoothFollow script configured to keep the camera pointing down above the vehicle. __defaultCamera__: camera mode to be used at startup. __showMirrors__: enables the mirrors (if available) in the Driver's view. __MirrorLeftTex, MirrorRightTex, MirrorRearText__: optional references to the GUITexture components that show the mirror images. Their containing GameObjects must have their transform configured to locate the textures properly on the screen. __enableImageEffects__: determines whether the referenced in the _ImageEffects_ list (below) are enabled or not. #### ImageEffects You can include the image effects of your choice (Component > Image Effects at Unity) in the main camera's GameObject. Optionally, you can reference these image effects here. This will allow all the effects to be enabled or disabled with the _enableImageEffects_ property, providing a "low quality" mode for the camera. The [live demo][] uses two image effects, _ColorCorrectionCurves_ and _ContrastStretchEffect_. The "low quality mode" can be toggled with the key F12, which also disables the shadows. [live demo]: http://www.edy.es/unity/offroader.html }}}