The Cinemachine ViewType allows the camera to be controlled by Unity’s Cinemachine. Cinemachine version 2.8 or later is required and the com.unity.cinemachine Assembly Definition Reference must be added to the Opsive.UltimateCharacterController Assembly Definition.

Downloads

Ultimate Character Controller
First Person Controller
Third Person Controller
UFPS: Ultimate First Person Shooter
UTPS: Ultimate Third Person Shooter
UFPM: Ultimate First Person Melee
UFPM: Ultimate Third Person Melee

Setup

  1. Ensure you are using Cinemachine 2.1+ and have added the Assembly Definition Reference.
  2. Import the Cinemachine integration package.
  3. Create a Cinemachine camera (through the Cinemachine toolbar). Ensure the CinemachineBrain component exists on the camera.
  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.
  5. Perform the following steps if you are using a third person perspective:
    1. Create a new GameObject and add the Cinemachine Virtual Camera or Free Look Virtual Camera component.
    2. Add the Third 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. If you are using a FreeLook virtual camera the CinemachineSpringExtension component should be added to that virtual camera so it will respond to spring events.

Inspected Fields

Virtual Camera

The VirtualCamera that should activate when the ViewType is active.

Look Direction Distance

The distance that the character should look ahead.

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.

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