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 2.8.4+.
  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 Virtual Camera component.
    2. Add the First Person Cinemachine ViewType to the Camera Controller.
    3. Specify the new Cinemachine Virtual Camera component in the Virtual Camera field of the newly added ViewType.
    4. The Cinemachine Virtual Camera component should have the following properties:
      1. Body: 3rd Person Follow. The follow object will be assigned at runtime.
      2. Damping: (0, 0, 0)
      3. Shoulder Offset: The offset from the character’s head. If the character doesn’t have a head bone then the offset will be relative to the character’s base.
      4. Virtual Arm Length: 0
      5. Camera Distance: 0
    5. The Cinemachine Camera Offset Extension should be added if the camera should change offsets when aiming.
  5. Perform the following steps if you are using a third person perspective:
    1. Create a new GameObject and add the Cinemachine Free Look component.
    2. Add the Third Person Cinemachine ViewType to the Camera Controller.
    3. Specify the new Cinemachine Free Look component in the Virtual Camera field of the newly added ViewType.
    4. Specify the following Cinemachine Free Look properties:
      1. Follow: The base character GameObject that the camera should follow.
      2. Look At: The head of the character.
    5. Add the Cinemachine Spring Extension component to the virtual camera so it will respond to spring events.
    6. The Cinemachine Camera Offset Extension component should be added if the camera should change offsets when aiming.
  6. The Virtual Camera with the highest priority will activate when the game starts.

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).