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.
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.
Installation
You can install Cinemachine from the Package Manager.
- In the Unity editor, select "Window" → "Package Management" → "Package Manager" (in Unity 6.0, "Window" → "Package Manager")
- Select "Unity Registry" in the list on the left
- Find "Cinemachine" in the list and click it
- 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.

| Element | Description |
|---|---|
| Body | Controls the camera's position (tracking, path movement, etc.) |
| Aim | Controls the camera's orientation (look-at behavior, screen composition, etc.) |
| Noise | Adds 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.

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
- Right-click in the Hierarchy window
- Select "Cinemachine" → "Cinemachine Camera"
When you create the first one, a Cinemachine Brain is added to the Main Camera automatically.
Setting Targets
| Target | Description |
|---|---|
| Tracking Target | The target the camera tracks. Unless you say otherwise, the camera also aims (Aim) at this target |
| Look At Target | Set this only when you want to look at something other than the tracked target (otherwise it looks at the Tracking Target) |
Main Body Types
| Type | Use Case |
|---|---|
| None (unset) | Doesn't move the camera (it stays where you placed it) |
| Follow | Tracks a target (for 3D games) |
| Position Composer | Keeps the target at a specific screen position (for 2D games) |
| Orbital Follow | Orbits around a target |
| Third Person Follow | Over-the-shoulder camera for TPS games |
| Spline Dolly | Moves 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.
- Create a Cinemachine Camera
- Set Position Control (Body) to "Third Person Follow"
- 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

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 TransposerandTransposerin 2.x have been renamed toPosition ComposerandFollowin 3.x.
Practical Examples
Example 1: A Camera That Follows Your Character
- Create a Cinemachine Camera
- 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
- Select the Virtual Camera
- In the Inspector, choose "Basic Multi Channel Perlin" in the "Noise" field
- 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)
- 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
- Select the Virtual Camera
- Choose "Add Extension" → "Cinemachine Deoccluder"
- Set the obstacle layers in "Collide Against"
- 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.
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
- On the Virtual Camera, choose "Add Component" → "Cinemachine Input Axis Controller"
- Create an Input Actions asset and set up a Look (Vector2) action
- 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
| Extension | Use Case |
|---|---|
| Cinemachine Deoccluder | Moves the camera to avoid obstacles |
| Cinemachine Impulse Source | Momentary camera shake (explosions, hits) |
| Cinemachine Impulse Listener | Receives the shake from an Impulse Source (add it to each camera you want to shake) |
| Cinemachine Follow Zoom | Adjusts FOV based on distance |
| Cinemachine Confiner 2D/3D | Confines 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();
}
}
- Add "Cinemachine Impulse Source" to an empty GameObject
- Add "Cinemachine Impulse Listener" to the Virtual Camera from "Add Extension"
- 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.
- Open the Timeline window (Window → Sequencing → Timeline)
- Add a Cinemachine Track to the Timeline, and drag the Main Camera (the one with the Cinemachine Brain) into the track's binding field
- Drag and drop multiple Virtual Cameras onto the Cinemachine Track
- 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):
- Set the Priority of the normal follow camera
VCam_Followto 10 (for both cameras, tick the Priority field's checkbox before entering the number) - Place
VCam_BossIntro(Priority 5) framing the boss head-on—normally its low Priority means it isn't used - Add a
Cinemachine Impulse Sourceto the boss, and anImpulse Listenerto bothVCam_FollowandVCam_BossIntro(the boss camera is the one that's live when the shake hits) - 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)

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?