A View Type determines the camera’s rotation, position, field of view, and look direction. The Camera Controller owns the available View Types and activates one of them; the active View Type then turns look input and character state into the view seen in Play Mode.

Choose the View Type together with its recommended character Movement Type. That pairing determines whether the camera and character rotate together, move independently, follow a path, or use a fixed composition.

Configure the Camera Controller

  1. Select the camera with the Camera Controller component.
  2. Expand View Types in the Inspector.
  3. Use the add control under the View Types list to add the required concrete View Type, then select it to configure its fields.
  4. In the Active column, select the View Type that should start active.
  5. When both first-person and third-person View Types are present, choose First Person View Type and Third Person View Type, then enable Can Change Perspectives only when the player should switch between them.
  6. Configure horizontal and vertical look mappings through Input, then test the camera with the paired Movement Type.

Camera Controller Inspector showing the View Types list, active selection, and View Type settings

Use Quick Setup when the camera has not been created yet. It can configure the initial perspective and View Type before this Inspector-level customization.

Choose first person, third person, or both

  • First person: Add a first-person View Type when the camera should represent the character’s own view. Verify first-person arms, item rendering, field of view, and look input together.
  • Third person: Add a third-person View Type when the character should remain visible. Choose the orbit, alignment, path, or fixed-angle behavior that matches the movement design.
  • Both perspectives: Add at least one valid View Type for each perspective, set both default dropdowns, and add Transition when the switch should blend instead of snapping. Do not select Transition as the normal active View Type; the Camera Controller activates it while changing between other View Types.

The Included View Types section contains the supplied options. Start with an included pairing before creating a custom View Type.

Choose an included first-person View Type

  • First Person contains the common first-person camera, overlay rendering, field-of-view, head-bob, and spring settings inherited by the concrete first-person options.
  • First Person Combat is the usual mouse-look or controller-look camera whose yaw follows first-person input.
  • First Person Free Look lets the camera look independently of the character; items continue to use their intended facing behavior instead of automatically firing along the camera direction.
  • First Person Transform Look follows a specified Transform and is useful for a temporary view such as looking from the character’s head after death.

Choose an included third-person View Type

  • Third Person contains the shared orbit, collision, offset, smoothing, field-of-view, zoom, and spring settings inherited by the concrete third-person options.
  • Adventure supports a freely rotating camera within configured yaw limits.
  • Combat keeps the character’s forward direction aligned with the camera’s local yaw.
  • RPG normally follows behind the character and allows free yaw while its camera-free-movement input is held.
  • Pseudo3D (2.5D) presents the character from the side and can follow the path used by the paired Pseudo3D Movement Type.
  • Top Down keeps the character in a top-down composition.
  • Third Person Look At points toward a target, or toward the character when no target is assigned, for views such as a death camera.

Configure transitions between View Types

Transition blends between the outgoing and incoming View Types. Configure its first-to-third, third-to-first, and third-to-third durations according to the transitions the game uses. A duration of 0 changes immediately.

Test a transition with the character standing, moving, aiming, and holding an item. The camera should preserve a sensible pitch, yaw, and character-facing direction throughout the blend.

Verify in Play Mode

  1. Confirm that the intended row is selected in the Active column before entering Play Mode.
  2. Move the horizontal and vertical look controls. The active View Type should rotate and position the camera without losing its character assignment.
  3. Move, stop, turn, jump, and aim. Character facing, item direction, and camera look direction should match the selected View Type and paired Movement Type.
  4. Test close walls, corners, slopes, and moving platforms. Confirm that collision, obstruction, offset, and smoothing settings do not produce clipping or sudden jumps.
  5. For first person, verify the arms and visible items at the near clip boundary and during field-of-view changes.
  6. For both perspectives, switch in both directions and confirm that the selected first-person and third-person defaults activate, the transition completes, and input still controls the new view.
  7. For Pseudo3D, Top Down, Look At, or Transform Look, exercise the specific path or target behavior rather than testing only ordinary movement.

Troubleshooting

Symptom Check Fix
Look input does not affect the camera. Horizontal or vertical look mappings may be missing, or the wrong Player Input implementation may be active. Verify Input and watch its look values in Play Mode.
The character faces a different direction from the camera design. The View Type and Movement Type may not be a recommended pair. Select the matching Movement Type, then retest movement, aim, and item use.
Perspective switching does nothing. A first-person or third-person default may be missing, or Can Change Perspectives may be disabled. Add a concrete View Type for each perspective, set both dropdowns, and enable switching.
A View Type is shown as Unknown View Type. Its class may no longer compile or its defining package or integration may be missing. Restore the dependency or resolve compiler errors, then remove and re-add the resolved View Type if needed.
SetViewType logs that it cannot find the type. The requested type is not in the Camera Controller’s View Types list. Add that View Type in the Inspector before selecting it from code.
The camera clips or snaps around obstacles. Collision radius, offsets, smoothing, or the chosen special-purpose View Type may not match the scene. Tune the active View Type in the problem location and retest at normal gameplay speed.

Retrieve a View Type in code

GetViewType<T> returns a View Type already added to the Camera Controller. ActiveViewType returns the currently active instance.

using UnityEngine;
using Opsive.Shared.Camera;
using Opsive.UltimateCharacterController.Camera;

public class MyObject : MonoBehaviour
{
    /// <summary>
    /// Retrieves the first-person Combat View Type.
    /// </summary>
    private void Start()
    {
        var camera = CameraUtility.FindCamera(null);
        if (camera == null) {
            return;
        }

        var cameraController = camera.GetComponent<CameraController>();
        var combatViewType = cameraController.GetViewType<Opsive.UltimateCharacterController.FirstPersonController.Camera.ViewTypes.Combat>();
        if (combatViewType != null) {
            Debug.Log("Found the Combat View Type.");
        }
    }
}

Create a custom View Type

Create a custom View Type only when none of the included options or supported integrations provide the required behavior. A concrete ViewType must identify its perspective and current rotation state, rotate and move the camera, and return the look direction used by character and item systems.

The current required members are:

public abstract bool FirstPersonPerspective { get; }
public abstract float Pitch { get; }
public abstract float Yaw { get; }
public abstract Quaternion BaseCharacterRotation { get; }
public abstract float LookDirectionDistance { get; }

public abstract Quaternion Rotate(float horizontalMovement, float verticalMovement, bool immediateUpdate);
public abstract Vector3 Move(bool immediateUpdate);
public abstract Vector3 LookDirection(
    Vector3 lookPosition,
    bool characterLookDirection,
    int layerMask,
    bool includeRecoil,
    bool includeMovementSpread);

This stationary third-person example keeps the camera at its current Transform while reporting the character’s forward direction for gameplay look queries:

using UnityEngine;
using Opsive.UltimateCharacterController.Camera.ViewTypes;

[System.Serializable]
public class MyViewType : ViewType
{
    private float m_Pitch;
    private float m_Yaw;
    private Quaternion m_BaseCharacterRotation;

    public override bool FirstPersonPerspective => false;
    public override float Pitch => m_Pitch;
    public override float Yaw => m_Yaw;
    public override Quaternion BaseCharacterRotation => m_BaseCharacterRotation;
    public override float LookDirectionDistance => 100;

    public override void ChangeViewType(bool activate, float pitch, float yaw, Quaternion baseCharacterRotation)
    {
        base.ChangeViewType(activate, pitch, yaw, baseCharacterRotation);

        if (activate) {
            m_Pitch = pitch;
            m_Yaw = yaw;
            m_BaseCharacterRotation = baseCharacterRotation;
        }
    }

    public override Quaternion Rotate(float horizontalMovement, float verticalMovement, bool immediateUpdate)
    {
        return m_Transform.rotation;
    }

    public override Vector3 Move(bool immediateUpdate)
    {
        return m_Transform.position;
    }

    public override Vector3 LookDirection(bool characterLookDirection)
    {
        return CharacterRotation * Vector3.forward;
    }

    public override Vector3 LookDirection(Vector3 lookPosition, bool characterLookDirection, int layerMask, bool includeRecoil, bool includeMovementSpread)
    {
        return CharacterRotation * Vector3.forward;
    }
}

After the class compiles, add it through the Camera Controller’s View Types list and verify it with the same Play Mode checks as an included View Type.