Getting Started with Unity Cinemachine: Cinematic Camera Work Without Writing Code

Created: 2026-02-05Last updated: 2026-10-10

Learn how to use Cinemachine, Unity's official camera control package. Achieve high-quality camera work—Virtual Cameras, camera shake, obstacle avoidance, and more—without writing scripts.

Cameras in film and anime chase, push in, cut, and shake. Try to write the same thing in Unity by poking at Camera.main.transform, and the blending on cuts, the way around obstacles, the compositing of shake—before you know it, you've grown a giant camera-only script.

The package that takes all of that off your hands is Cinemachine, Unity's official camera control package. With almost zero scripting, you can build "cinematic camera work"—following, switching, shake, and obstacle avoidance.

Conceptual image of Cinemachine: of the several cameras surrounding a subject, only one is active at a time, switching smoothly under the director's baton

What You'll Learn

  • Cinemachine's core concepts — Cinemachine Camera and Brain
  • Choosing the right Body type (Follow, Position Composer, Third Person Follow, and more)
  • Practical examples — following, switching, camera shake, and obstacle avoidance
  • Integration with the Input System and Timeline
  • Practical: building a boss-entrance showcase camera

If you want to fine-tune how a follow camera tracks its target, see the companion article Follow Cameras in Practice (tuning Dead Zone, Damping, and Confiner 2D).

Tested with: Unity 6 (6000.x), Cinemachine 3.x

Version note: This article targets Cinemachine 3.x. Cinemachine 2.x uses different component names and APIs (e.g., CinemachineVirtualCamera → CinemachineCamera). Check which version your project uses.

Sponsored

Installation

You can install Cinemachine from the Package Manager.

  1. In the Unity editor, select "Window" → "Package Management" → "Package Manager" (in Unity 6.0, "Window" → "Package Manager")
  2. Select "Unity Registry" in the list on the left
  3. Find "Cinemachine" in the list and click it
  4. Click the "Install" button in the bottom right

Cinemachine Core Concepts

Virtual Camera

A Virtual Camera is a virtual camera you place in the scene. It doesn't render anything itself; instead, it sends position and orientation data to the Cinemachine Brain on the Main Camera.

A Virtual Camera is made up of three main elements.

The three elements of a Virtual Camera. Body = decides the position (following, etc.), Aim = decides the orientation (looking at a target, etc.), Noise = adds shake (handheld jitter, camera shake)
ElementDescription
BodyControls the camera's position (tracking, path movement, etc.)
AimControls the camera's orientation (look-at behavior, screen composition, etc.)
NoiseAdds camera shake and handheld jitter

In the Cinemachine 3.x Inspector, Body appears as Position Control and Aim as Rotation Control.

Cinemachine Brain

The Cinemachine Brain is a component attached to the Main Camera. It manages all Virtual Cameras in the scene and decides which Virtual Camera is active.

Diagram of the relationship between Cinemachine Cameras and the Brain. Multiple Cinemachine Cameras (normal, boss-battle, event, etc.) send their data, the Brain adopts the one with the highest Priority, and it drives the single Main Camera that actually renders

Which camera goes live is decided by its Priority value: the highest one wins. In the Inspector, tick the checkbox on the Priority field before entering a number. While it's unticked, the field shows "(using default)" and counts as 0. If you change Priority in the Inspector during Play, the camera switches on the spot, so you can try it out before writing any code.

Virtual Camera Basics

Creating a Virtual Camera

  1. Right-click in the Hierarchy window
  2. Select "Cinemachine" → "Cinemachine Camera"

When you create the first one, a Cinemachine Brain is added to the Main Camera automatically.

Setting Targets

TargetDescription
Tracking TargetThe target the camera tracks. Unless you say otherwise, the camera also aims (Aim) at this target
Look At TargetSet this only when you want to look at something other than the tracked target (otherwise it looks at the Tracking Target)

Main Body Types

TypeUse Case
None (unset)Doesn't move the camera (it stays where you placed it)
FollowTracks a target (for 3D games)
Position ComposerKeeps the target at a specific screen position (for 2D games)
Orbital FollowOrbits around a target
Third Person FollowOver-the-shoulder camera for TPS games
Spline DollyMoves along a path

Third Person Follow (TPS Camera)

This is the most commonly used camera type in third-person shooters. It places the camera over the player's shoulder and supports aiming controls.

  1. Create a Cinemachine Camera
  2. Set Position Control (Body) to "Third Person Follow"
  3. Adjust the parameters:
    • Shoulder Offset: Offset from the shoulder (the default 0.5, -0.4, 0 puts it over the right shoulder; X is sideways, Y is height)
    • Camera Distance: Distance from the player
    • Damping: Smoothness of the follow behavior
Diagram of Third Person Follow (over-the-shoulder camera). Viewing the player from behind, the camera sits above the right shoulder. Shoulder Offset adjusts the sideways offset from the shoulder, and Camera Distance adjusts the distance behind

If the camera sinks into walls, enable Avoid Obstacles on the Third Person Follow (it's off by default). Put the player's tag (Player) in Ignore Tag so the player's own collider isn't treated as a wall.

Changes from Cinemachine 2.x: Components named Framing Transposer and Transposer in 2.x have been renamed to Position Composer and Follow in 3.x.

Sponsored

Practical Examples

Example 1: A Camera That Follows Your Character

  1. Create a Cinemachine Camera
  2. Configure the following:
    • Tracking Target: The character's Transform
    • Position Control (Body): Follow
    • Follow Offset: (0, 2, -5)
    • Rotation Control (Aim): Rotation Composer

If you want the camera to swing around behind the character when it turns, set the Follow's Binding Mode to Lock To Target With World Up (with the default World Space, it doesn't swing around).

Example 2: Switching Smoothly Between Multiple Cameras

using UnityEngine;
using Unity.Cinemachine;

public class CameraSwitcher : MonoBehaviour
{
    [SerializeField] private CinemachineCamera camera1;
    [SerializeField] private CinemachineCamera camera2;

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            camera1.Priority.Value = 15;
            camera2.Priority.Value = 5;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            camera1.Priority.Value = 5;
            camera2.Priority.Value = 15;
        }
    }
}

Input.GetKeyDown belongs to the old Input Manager. If it doesn't respond in a new Unity 6 project, set Active Input Handling under Project Settings > Player to Both (this restarts the editor).

Example 3: Implementing Camera Shake

  1. Select the Virtual Camera
  2. In the Inspector, choose "Basic Multi Channel Perlin" in the "Noise" field
  3. Set the Noise Profile (important):
    • Click the circle button to the right of the "Noise Profile" field
    • Select a preset such as "6D Shake" (the shake won't work if no Noise Profile is set)
  4. Configure the parameters:
    • Amplitude Gain: 1.0 (amplitude)
    • Frequency Gain: 1.0 (frequency)

Important: Without a Noise Profile assigned, changing Amplitude or Frequency has no effect—no shake will occur. Use one of Unity's built-in presets such as "6D Shake" or "Handheld_normal_mild", or create your own NoiseSettings asset.

using UnityEngine;
using Unity.Cinemachine;

public class CameraShake : MonoBehaviour
{
    [SerializeField] private CinemachineCamera virtualCamera;
    private CinemachineBasicMultiChannelPerlin noise;

    void Awake()
    {
        // Get the Noise component
        noise = virtualCamera.GetComponent<CinemachineBasicMultiChannelPerlin>();
    }

    public void Shake(float amplitude, float frequency, float duration)
    {
        if (noise == null) return;

        noise.AmplitudeGain = amplitude;
        noise.FrequencyGain = frequency;
        Invoke(nameof(StopShake), duration);
    }

    void StopShake()
    {
        noise.AmplitudeGain = 0f;
        noise.FrequencyGain = 0f;
    }
}

Example 4: A Camera That Avoids Obstacles

  1. Select the Virtual Camera
  2. Choose "Add Extension" → "Cinemachine Deoccluder"
  3. Set the obstacle layers in "Collide Against"
  4. Put the player's tag (Player) in "Ignore Tag" (otherwise the player itself can count as an obstacle, and the camera pushes in too close)

Walls without a Collider aren't treated as obstacles.

Sponsored

Working with the Input System

To implement player-controlled camera rotation with Orbital Follow, use the CinemachineInputAxisController (Pan Tilt under Rotation Control can be driven the same way). Third Person Follow has no input axes, so rotate the object you set as its Tracking Target from your own script.

Setup Steps

  1. On the Virtual Camera, choose "Add Component" → "Cinemachine Input Axis Controller"
  2. Create an Input Actions asset and set up a Look (Vector2) action
  3. Assign it to the "Input Action" field of the CinemachineInputAxisController

Code Example (Controlling from a Script)

using UnityEngine;
using UnityEngine.InputSystem;
using Unity.Cinemachine;

public class CameraLookController : MonoBehaviour
{
    [SerializeField] private CinemachineCamera virtualCamera;
    [SerializeField] private InputActionReference lookAction;

    private CinemachineOrbitalFollow orbitalFollow;

    void Awake()
    {
        orbitalFollow = virtualCamera.GetComponent<CinemachineOrbitalFollow>();
    }

    void OnEnable() => lookAction.action.Enable();
    void OnDisable() => lookAction.action.Disable();

    void Update()
    {
        Vector2 lookInput = lookAction.action.ReadValue<Vector2>();
        // Update the horizontal rotation of Orbital Follow
        orbitalFollow.HorizontalAxis.Value += lookInput.x * Time.deltaTime * 100f;
    }
}

Note: When using the New Input System, make sure the Input System Package is enabled in Project Settings.

Extensions

ExtensionUse Case
Cinemachine DeoccluderMoves the camera to avoid obstacles
Cinemachine Impulse SourceMomentary camera shake (explosions, hits)
Cinemachine Impulse ListenerReceives the shake from an Impulse Source (add it to each camera you want to shake)
Cinemachine Follow ZoomAdjusts FOV based on distance
Cinemachine Confiner 2D/3DConfines the camera to an area

Impulse Source (Momentary Shake)

For momentary camera shake on explosions or when taking damage, the Impulse System is the right tool.

using UnityEngine;
using Unity.Cinemachine;

public class ExplosionShake : MonoBehaviour
{
    [SerializeField] private CinemachineImpulseSource impulseSource;

    public void Explode()
    {
        // Generate an impulse from the explosion position
        impulseSource.GenerateImpulse();
    }
}
  1. Add "Cinemachine Impulse Source" to an empty GameObject
  2. Add "Cinemachine Impulse Listener" to the Virtual Camera from "Add Extension"
  3. Call GenerateImpulse() from your script

Skip step 2 and nothing shakes no matter how many times you call it, and the Console stays silent. If you switch between cameras, add a Listener to every camera you want to shake.

Timeline Integration

Combining Cinemachine with Timeline makes it easy to create cutscenes and scripted events.

  1. Open the Timeline window (Window → Sequencing → Timeline)
  2. Add a Cinemachine Track to the Timeline, and drag the Main Camera (the one with the Cinemachine Brain) into the track's binding field
  3. Drag and drop multiple Virtual Cameras onto the Cinemachine Track
  4. Adjust the placement and duration of each Virtual Camera

Best Practices

  • Use a consistent naming convention for Virtual Cameras - e.g., "VCam_Follow", "VCam_Boss"
  • Set Priorities thoughtfully - Spacing them in increments of 10 makes it easy to insert new cameras later
  • Adjust Damping to control smoothness - Lower values for action games, higher for adventure games
  • Tune the Blend Time - Around 1–2 seconds usually feels natural
  • Take advantage of Extensions - Obstacle avoidance, camera shake, area confinement, and more

Practical: Building a Boss-Entrance Camera

A boss entrance in an action game, an event scene in an RPG, a goal celebration in a racing game—a showcase moment where you "hand the camera the spotlight for just an instant" can be built purely by combining the parts you learned in this article (Priority switching + Impulse shake). Let's build a boss entrance as an example.

Scene prep (the no-code part):

  1. Set the Priority of the normal follow camera VCam_Follow to 10 (for both cameras, tick the Priority field's checkbox before entering the number)
  2. Place VCam_BossIntro (Priority 5) framing the boss head-on—normally its low Priority means it isn't used
  3. Add a Cinemachine Impulse Source to the boss, and an Impulse Listener to both VCam_Follow and VCam_BossIntro (the boss camera is the one that's live when the shake hits)
  4. On the Main Camera's Cinemachine Brain, set the Default Blend time to 0.5 seconds (with the default 2 seconds, the shake one second in lands while the camera is still moving)
Flow of the boss-entrance camera. From the normal follow camera, it blends smoothly to the boss camera whose Priority rose on the boss entrance, an Impulse shake fires on the landing impact, and a few seconds later it returns to the player's camera

After that, the entrance event just needs to temporarily flip the Priorities.

using System.Collections;
using UnityEngine;
using Unity.Cinemachine;

public class BossIntroDirector : MonoBehaviour
{
    [SerializeField] private CinemachineCamera bossIntroCam; // Priority 5
    [SerializeField] private CinemachineImpulseSource landingImpulse;
    [SerializeField] private float introDuration = 3f;

    // Call from the boss-entrance event
    public void PlayBossIntro()
    {
        StartCoroutine(IntroRoutine());
    }

    private IEnumerator IntroRoutine()
    {
        bossIntroCam.Priority.Value = 20;      // Higher than Follow (10) → auto-blends
        yield return new WaitForSeconds(1f);   // Wait for the camera to push all the way in

        landingImpulse.GenerateImpulse();      // Shake on the boss's landing impact

        yield return new WaitForSeconds(introDuration);
        bossIntroCam.Priority.Value = 5;       // Lower it and it auto-blends back to the player
    }
}

The blending on the cut and the blend back on the return are all handled automatically by the Brain, so all the code does is "raise and lower Priority" and "fire the shake." There isn't a single line that moves the camera in code.

To try it, temporarily call PlayBossIntro() from Start(). On Play, the camera pushes in on the boss in 0.5 seconds, the screen shakes one second in, and three seconds after that it blends back to the player's camera over 0.5 seconds. If it never comes back from the boss shot, check the Priority checkbox on VCam_Follow. While it's unticked, it counts as 0 and loses to the boss camera you lowered to 5.

There are two key points: "leave the showcase camera in place and call it by Priority" (rather than spawning cameras dynamically, the Cinemachine way is to keep them waiting in the scene), and "tune how satisfying the cut feels with the Brain's Blend Time" (default 2 seconds; for a snappy entrance, tighten it down to around 0.5 seconds). When your cuts get more complex, the right move is to graduate from code and step up to Timeline integration.

Summary

Cinemachine is a powerful tool for controlling Unity cameras.

  • Implement camera work without scripts - Just configure it in the Inspector
  • Adapts automatically to animation and terrain changes - No manual adjustments needed
  • Achieve high-quality camera work quickly - Following, switching, shake, and obstacle avoidance
  • For showcase moments, "call a waiting camera by Priority" - no code that moves the camera
  • Create cinematic sequences with Timeline integration - Cutscenes and scripted events

Give Cinemachine a try and bring cinematic camera work to your game. That boss-entrance scene in your game—what kind of camera is showing it off right now?

Further Learning

Read nextNext in the learning path
Rendering

Cinemachine Follow Cameras in Practice: Tuning How Good the Follow Feels

Read this note
Unity Notes in this section100