In this lesson, you will learn how to configure the Cinemachine Brain to define custom blend curves and durations, ensuring your player's perspective shifts feel cinematic and polished rather than jarring.
The Role of the Cinemachine Brain
The Cinemachine Brain acts as the conductor for your virtual cameras. Whenever you switch from one camera to another (by changing the Priority value), the Brain intercepts the request. Instead of snapping instantly to the new view, it can perform an interpolation between the current "Live" camera and the incoming one.
Customizing the Transition
To control how this switch feels, select your Main Camera object (where the CinemachineBrain component resides) and look at the Custom Blends section. Here, you can define specific behavior:
- Default Blend: Set a global duration (e.g., 1.5 seconds) and an interpolation style (like
Ease In Out). This makes every transition feel smooth by default. - Per-Camera Blends: By clicking the plus icon, you can create a lookup table. You can specify that a transition from "Camera_Idle" to "Camera_Combat" takes exactly 0.5 seconds with a sharp
Ease Incurve, while moving back to "Camera_Idle" takes a slower, 2-secondEase Outtransition.
Implementing via Scripting
While the inspector is great for static setups, you can also influence these transitions during gameplay by accessing the Brain’s m_DefaultBlend property through code:
using Cinemachine;
public class CameraSwitcher : MonoBehaviour
{
public CinemachineBrain brain;
public void SetFastTransition()
{
// Change the default blend to a quick 0.3s linear cut
brain.m_DefaultBlend = new CinemachineBlendDefinition(
CinemachineBlendDefinition.Style.Linear, 0.3f);
}
}
By manipulating these curves and timings, you move beyond simple "cuts" and start orchestrating a professional visual language for your game. You aren't just moving the camera; you are guiding the player's eye through the narrative space you've built.
Key Takeaway: The Cinemachine Brain transforms camera switches from jarring cuts into fluid, professional transitions by applying customizable blend durations and interpolation curves between active virtual cameras.