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

Created: 2026-02-05Last updated: 2026-07-12

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 2022.3 LTS / Unity 6, Cinemachine 3.x

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

Sponsored

Installation

You can install Cinemachine from the Package Manager.

  1. In the Unity editor, select "Window" → "Package Manager"
  2. From the dropdown in the top left, select "Unity Registry"
  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

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

Virtual Camera Basics

Creating a Virtual Camera

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

Setting Targets

TargetDescription
Tracking TargetThe target the camera tracks (affects the Body settings)
Look At TargetThe target the camera looks at (affects the Aim settings)

Main Body Types

TypeUse Case
Do NothingKeeps the position fixed
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 Body to "Third Person Follow"
  3. Adjust the parameters:
    • Shoulder Offset: Offset from the shoulder (e.g., 0.5, 0, 0 for over the right shoulder)
    • 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

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
    • Look At Target: The character's Transform
    • Body: Follow
    • Follow Offset: (0, 2, -5)
    • Aim: Composer

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;
        }
    }
}

Example 3: Implementing Camera Shake

  1. Select the Virtual Camera
  2. Choose "Add Extension" → "Cinemachine Basic Multi Channel Perlin"
  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 from the extension
        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"
Sponsored

Working with the Input System

To implement player-controlled camera rotation with Orbital Follow or Third Person Follow, use the CinemachineInputAxisController.

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 Basic Multi Channel PerlinContinuous camera shake (handheld jitter, vibration)
Cinemachine Impulse SourceMomentary camera shake (explosions, hits)
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
  3. Call GenerateImpulse() from your script

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
  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. Leave the normal follow camera VCam_Follow (Priority 10) as is
  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 the Cinemachine Camera on the Main Camera side
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.

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