Key Takeaways
- Cinemachine is a free Unity package that controls the camera procedurally. You set a target and a behavior, and it handles movement, aiming and blending.
- Check your version first. Cinemachine 3 uses the CinemachineCamera component and the Unity.Cinemachine namespace, while older tutorials use Cinemachine 2.x names such as Virtual Camera and Transposer.
- The simplest start is GameObject, Cinemachine, Targeted Cameras, Follow Camera, then set the Tracking Target.
- Switch cameras with priority, and remember that a deactivated CinemachineCamera does not use processing power.
- Test cameras on real devices and aspect ratios, and keep shake gentle for player comfort.
Table of Contents
If you are looking for a Unity Cinemachine tutorial that does not assume any camera experience, this guide is for you. A camera script that follows the player looks simple, until you add smoothing, level boundaries, cutscenes, a boss intro and different screen sizes. Cinemachine solves these problems without a pile of custom code.
This guide shows how to install Cinemachine, create a follow camera, choose position and rotation behaviors, switch cameras with priority, add camera shake and fix common problems. It follows Unity’s official documentation for Cinemachine 3.x, and Cinemachine’s behavior depends on the package version you use, so we point out where versions matter.
Unity Cinemachine Tutorial: What Cinemachine Does and Why It Helps
Unity describes Cinemachine as a suite of modules for controlling the Unity camera. It is a free package that you install like any other package. After installation, a new Cinemachine menu appears under GameObject.
The idea is different from moving the camera yourself. Your scene keeps one normal Unity Camera with a Cinemachine Brain component. You then add one or more Cinemachine Cameras. These are not real cameras. They describe how the real camera should behave: what to follow, where to stand and how to aim. The Brain decides which Cinemachine Camera is live and blends between them.
That structure helps in real projects. A runner, a racing game and a boss fight can each have their own camera behavior, and you switch between them without rewriting your camera script.
Which Cinemachine Version Are You Using?
This is the most common beginner problem, because many tutorials are written for older versions. Unity’s announcement for Cinemachine 3 says that Cinemachine 3 is compatible with Unity 2022.3 and later, that it is official from Unity 6000.0 and that new projects in Unity 6 have Cinemachine 3 by default.
Unity’s upgrade guide lists the main renames. If your tutorial uses a name from the left column, your version is probably Cinemachine 2.x.
| Cinemachine 2.x | Cinemachine 3.x |
|---|---|
| CinemachineVirtualCamera and CinemachineFreeLook | CinemachineCamera |
| Transposer | CinemachineFollow |
| Framing Transposer | CinemachinePositionComposer |
| Composer | CinemachineRotationComposer |
| POV | CinemachinePanTilt |
| Tracked Dolly | CinemachineSplineDolly |
| Namespace Cinemachine | Namespace Unity.Cinemachine |
Unity also warns that Cinemachine 3 is a major change, that scripts written for 2.x are unlikely to run without manual changes and that, in many projects with custom Cinemachine scripts, staying on 2.x may be better. If you are starting a new project, use Cinemachine 3. If you maintain an old project, read the upgrade guide before you change the package.
Step 1: Install Cinemachine and Check Your Camera
Open Window, then Package Manager, search for Cinemachine in the Unity Registry and install it. If you created a Unity 6 project, it may already be installed. After installation, check that the GameObject menu has a Cinemachine entry. You can also import the package’s sample scenes from the Package Manager to see working examples.
Your scene needs one Main Camera. Do not delete it, because Cinemachine controls this camera through the Brain.
Step 2: Create Your First Follow Camera
Unity’s guide to following and framing a character gives the quickest setup:
- Make sure your scene has a GameObject you want to follow, such as the player.
- Choose GameObject, Cinemachine, Targeted Cameras, Follow Camera. Unity adds a GameObject with a Cinemachine Camera component, a Cinemachine Follow component for position and a Cinemachine Rotation Composer for rotation.
- Check that your Unity Camera has a Cinemachine Brain component.
- In the Cinemachine Camera component, set the Tracking Target to the player.
If you right-click the player in the Hierarchy and create the Follow Camera from there, the Tracking Target is filled in automatically. Press Play and move the player. The camera follows and looks at the player.
Next, adjust the follow offset and the damping. Damping controls how quickly the camera catches up. Small values feel tight and responsive, while larger values feel smoother but slower. Try both on a real device, because phone screens are small and strong lag can feel uncomfortable.
Step 3: Understand Position Control and Rotation Control
A Cinemachine Camera has two jobs: where to stand and where to look. Unity’s Cinemachine Camera reference lists the options. You can select one Position Control behavior and one Rotation Control behavior at a time.
| Position Control | What it does |
|---|---|
| Follow | Moves in a fixed relationship to the Tracking Target |
| Orbital Follow | Moves in a variable relationship to the target and can accept player input |
| Third Person Follow | Pivots around the player for third-person views |
| Position Composer | Keeps a fixed screen-space relationship to the target |
| Hard Lock to Target | Uses the same position as the target |
| Spline Dolly | Moves along a predefined path |
| Rotation Control | What it does |
|---|---|
| Rotation Composer | Keeps the Look At target in the frame, with composition controls and damping |
| Hard Look At | Keeps the Look At target in the center of the frame |
| Pan Tilt | Rotates the camera, optionally from player input |
| Rotate With Follow Target | Matches the rotation of the Tracking Target |
The reference page also explains the Lens settings. A perspective camera uses a Field of View, and an orthographic camera uses an Orthographic Size, which is the half-height of the view in world units. That second setting matters for 2D mobile games.
Camera Setups for Common Mobile Game Types
No setup fits every game, but these starting points work well for beginners. Treat them as ideas to test, not as rules.
| Game type | Starting setup | Why |
|---|---|---|
| 2D platformer or runner | Position Composer with an orthographic lens, plus Confiner 2D | Keeps the player in a stable screen position and stops the camera leaving the level |
| 3D third-person | Third Person Follow | Pivots around the character and has built-in collision handling |
| Racing or vehicle game | Follow with Rotate With Follow Target, or Hard Lock to Target | Keeps the camera behind the vehicle |
| Top-down game | Follow with Hard Look At | Keeps the target centered |
| Cutscene or intro fly-through | Spline Dolly | Moves along a path |
Unity’s documentation notes that Third Person Follow has a built-in collision resolution system, so the camera is adjusted when the target is close to an obstacle. Racing games often need a different feel from character games, so tune damping and offsets on a real track. As examples of our work in driving games, you can browse our Circuit Car Racing Unity source code project and our off-road truck simulator 2024 Unity project. We do not describe what they include here.
Step 4: Switch Between Cameras with Priority
Most games need more than one camera: a gameplay camera, a boss intro, a victory shot. Unity’s reference says each Cinemachine Camera can be Live, Standby or Disabled. A Live camera controls the Unity camera. A Standby camera does not control it. A Disabled camera, which is a deactivated GameObject, does not follow or aim and does not use processing power.
When several cameras are active, priority decides which one is live. In general, the most recently activated, highest priority camera controls the main camera. You can also tell the Brain to blend between cameras for a smooth transition.
The script below switches two cameras by changing their priority. In Cinemachine 3, Priority is a PrioritySettings value, and Unity documents an implicit conversion from int, so assigning a number works. It is a starting point, not a production-complete system. Test it in your Unity and Cinemachine version.
// Cinemachine 3.x (namespace Unity.Cinemachine). Cinemachine 2.x uses different names.
using Unity.Cinemachine;
using UnityEngine;
public class CameraSwitcher : MonoBehaviour
{
[SerializeField] private CinemachineCamera gameplayCamera;
[SerializeField] private CinemachineCamera bossCamera;
private const int LivePriority = 20;
private const int StandbyPriority = 10;
public void ShowGameplayCamera() => SetLive(gameplayCamera, bossCamera);
public void ShowBossCamera() => SetLive(bossCamera, gameplayCamera);
private void SetLive(CinemachineCamera live, CinemachineCamera other)
{
// Int converts implicitly to PrioritySettings in Cinemachine 3.
live.Priority = LivePriority;
other.Priority = StandbyPriority;
}
}
What the script does: it gives the camera you want a higher priority, so the Brain makes it live and blends to it. Call ShowBossCamera from a trigger, an animation event or a timeline signal. If priorities seem to be ignored after an upgrade from version 2.x, check that the Priority field is enabled on the camera, because a disabled field uses the default priority of 0.
Step 5: Add Camera Shake and Polish
Camera shake adds impact to hits, explosions and landings. Unity’s guide to adding procedural behavior shows how to add a Basic Multi Channel Perlin noise component to a Cinemachine Camera and choose a noise profile. Cinemachine also includes Impulse components, such as an Impulse Source and an Impulse Listener, for shake triggered by events.
Use shake with care. Strong, constant shake can be uncomfortable or hard to read on a small phone screen. Give players an option to reduce it, and read our Unity game accessibility guide for related ideas. If your camera also responds to player input, see our guide to Unity Input System rebinding so controls stay flexible.
Step 6: Keep the Camera Inside the Level
In 2D games and tight 3D levels, the camera should not show empty space beyond the level edges. Cinemachine includes Confiner 2D and Confiner 3D extensions for this purpose. Add a Confiner to the Cinemachine Camera and assign a boundary shape. Then test the edges with different aspect ratios, because a wide screen shows more of the world than a narrow one.
Good level design helps the camera too. Our 3D game environment design workflow explains how to plan spaces so the camera has room to work.
Mobile Considerations: Performance and Screen Sizes
Cameras are cheap compared with rendering, but a few habits help on phones:
- Disable cameras you do not need. Unity states that a disabled Cinemachine Camera does not consume processing power.
- Check the Standby Update setting. The reference lists Never, Always and Round Robin options for updating cameras that are not live, so you can avoid updating cameras you will not use soon.
- Test several aspect ratios. A fixed orthographic size shows different widths on different devices.
- Keep important action away from screen edges and notches. Our guide to the Unity mobile UI safe area explains the interface side of this problem.
For general performance habits, read our Unity mobile game optimization guide, and test camera behavior with the checks in our Unity game QA checklist.
A Hypothetical Example: Camera Plan for a Runner and a Racing Game
This example is illustrative, not a real project. A small team builds two mobile games and plans their cameras.
| Camera | Runner game | Racing game |
|---|---|---|
| Main gameplay | Position Composer with an orthographic lens | Follow with Rotate With Follow Target |
| Start intro | Spline Dolly flying over the level | Hard Lock to Target at the starting grid |
| Impact feedback | Small noise on hit | Short impulse on collision |
| Boundaries | Confiner 2D for the level | None |
| Switching | Priority change after the intro | Priority change at the finish line |
The team builds each camera in the Editor, tests it on three phones and then tunes damping and offset until the motion feels clear and comfortable.
Troubleshooting: Cinemachine Camera Not Following
| Symptom | Likely cause | What to try |
|---|---|---|
| Camera does not move | No Cinemachine Brain on the Unity camera | Add a Brain to the Main Camera |
| Camera does not follow the player | Tracking Target is empty | Assign the target in the Cinemachine Camera component |
| Wrong camera is live | Priority is higher on another active camera | Check priorities and active cameras |
| Priority changes do nothing after an upgrade | The Priority field is not enabled | Enable it, or re-run the upgrade tool |
| Tutorial code does not compile | Code written for Cinemachine 2.x | Update the namespace to Unity.Cinemachine and use the new class names |
| Virtual Camera is missing from the menu | You use Cinemachine 3 | Use Targeted Cameras or the CinemachineCamera component |
If the camera shakes or stutters while following a moving object, check how and when your target is moved, and check the Brain settings for your version. Test one change at a time.
Common Mistakes in Cinemachine Setup
- Following a tutorial for the wrong version. Check the component names first.
- Removing the Main Camera or the Brain.
- Leaving the Tracking Target empty.
- Using very high damping and making the game feel laggy.
- Forgetting aspect ratios and cutting off the action on some phones.
- Too much camera shake with no way to reduce it.
- Keeping many unused cameras active instead of disabling them.
- Upgrading the package without a backup.
Conclusion
This Unity Cinemachine tutorial covered the essentials: check your version, install the package, create a Follow Camera, choose position and rotation behaviors, switch cameras with priority, add gentle shake and test on real devices. Start with one simple camera, make it feel right and add more only when your game needs them. Always check Unity’s documentation for your Cinemachine version, because names and menus change.
At GamePro Studio, we build Unity games, 3D art and game UI/UX for mobile, PC and VR. If you need help with camera systems or your next Unity project, you can start with our Unity game developer hiring service
Frequently Asked Questions (FAQs)
Is Cinemachine free?
Yes. Unity describes it as a free package that is available for any project. You install it through the Package Manager.
Should I use Cinemachine 2 or Cinemachine 3?
For new projects, use Cinemachine 3, which is the default in new Unity 6 projects. For old projects with custom Cinemachine scripts, Unity says staying on 2.x may be better, because the upgrade can require manual changes.
Why can I not find Cinemachine Virtual Camera?
In Cinemachine 3, the Virtual Camera was renamed to CinemachineCamera. Use the GameObject, Cinemachine menu to create a Follow Camera or another targeted camera.
Can I use Cinemachine in a 2D mobile game?
Yes. Use an orthographic camera and a behavior such as Position Composer, and add a Confiner 2D to keep the camera inside the level. Test several aspect ratios.
Does Cinemachine slow down my game?
Cameras that are disabled do not use processing power, and you can control how often standby cameras update. As always, measure on a real device with the Profiler.