Cinemachine

The Cinemachine ViewType allows the camera to be controlled by Unity’s Cinemachine. Cinemachine version 2.8.4 or later is required.

Setup

  1. Ensure you are using Cinemachine 3.0.1+.
  2. Download and import the Cinemachine integration package.
  3. Create a Cinemachine camera (through the Cinemachine toolbar). Ensure the CinemachineBrain component exists on the same GameObject as the Camera Controller.
  4. Perform the following steps if you are using a first person perspective:
    1. Create a new GameObject and add the Cinemachine Camera component.
    2. Add the First Person Cinemachine ViewType to the Camera Controller.
    3. Specify the Cinemachine Camera created in step 4.1 to the Cinemachine Camera field of the newly added ViewType.
    4. The Cinemachine Camera component should have the following properties:
      1. Tracking Target: The character’s head.
      2. Position Control: Orbital Follow
      3. Rotation Control: Pan Tilt
    5. The Cinemachine Orbital Follow component should have the following properties:
      1. Target Offset: (0, 0, 0)
      2. Position Damping: (0, 0, 0)
      3. Radius: 0
    6. The Cinemachine Camera Offset Extension should be added if the camera should change offsets when aiming.
    7. Your first person Cinemachine Camera should look similar to:
  5. Perform the following steps if you are using a third person perspective:
    1. Create a new GameObject and add the Cinemachine Camera component.
    2. Add the Third Person Cinemachine ViewType to the Camera Controller.
    3. Specify the Cinemachine Camera created in step 5.1 to the Cinemachine Camera field of the newly added ViewType.
    4. The Cinemachine Camera component should have the following properties:
      1. Tracking Target: your character
      2. Position Control: Orbital Follow
      3. Rotation Control: Rotation Composer
    5. The Cinemachine Orbital Follow component should have the following properties:
      1. Target Offset: (0, 0, 0)
      2. Radius: 4
    6. The Cinemachine Rotation Composer should have the following properties:
      1. Target Offset: 1.81
    7. The Cinemachine Camera Offset Extension component should be added if the camera should change offsets when aiming.
    8. Your third person Cinemachine Camera should look similar to:

Inspected Fields

Field of View

The field of view of the main camera.

Field of View Damping

The damping time of the field of view angle when changed.

Virtual Camera

The VirtualCamera that should activate when the ViewType is active.

Look Direction Distance

The distance that the character should look ahead.

Use Character Look Direction

Should the character’s forward direction be used for the look direction?

Camera Offset

The offset of the CameraOffset extension module.

Position Spring

The positional spring used for regular movement.

Rotation Spring

The rotational spring used for regular movement.

Secondary Position Spring

The positional spring which returns to equilibrium after a small amount of time (for recoil).

Secondary Rotation Spring

The rotational spring which returns to equilibrium after a small amount of time (for recoil).