Cinemachine Brain
The Cinemachine Brain is a component in the Unity camera itself. Cinemachine Brain monitors all active CinemachineCameras in the Scene. It chooses the next CinemachineCamera to control the Unity camera. It also controls the cut or blend from the current CinemachineCamera to the next.
Objects with a Cinemachine Brain are displayed in the hierarchy with a little CinemachineCamera icon next to them. You can turn that off from the Cinemachine Preferences panel.
To add a Cinemachine Brain component to a Unity camera, do one of the following:
Use the GameObject > Cinemachine menu to Add a CinemachineCamera to your Scene. Unity adds a Cinemachine Brain component to the Unity camera for you if there isn’t one already.
Add a Cinemachine Brain component to the Unity camera yourself.
Tip: You can also control CinemachineCameras from Timeline. Timeline overrides the decisions that Cinemachine Brain would otherwise make.
Cinemachine Brain holds the following key properties:
Blend Settings: A list that defines how to blend from one CinemachineCamera to another. For example, add an item to the list for a 4 second blend from vcam1 to vcam2 then add another item for a 1 second blend from vcam2 back to vcam1. If a blend between two cameras isn’t defined, Cinemachine Brain uses its default blend.
Channel Filter: Cinemachine Brain uses only those CinemachineCameras that output to Channels present in the Channel Mask. You can set up split-screen environments by using the Channel Mask to filter channels.
Event Dispatching: Cinemachine Brain fires events when it changes shot. It fires an event when a CinemachineCamera goes live. It also fires an event when it cuts from one CinemachineCamera to another. Use the latter event to reset temporal post effects.
Properties:
Property: | Function: | |
---|---|---|
Show Debug Text | Check to display a textual summary of the live CinemachineCamera and blend in the view. | |
Show Camera Frustum | Check to display the frustum of the camera in the Scene view. | |
Ignore Time Scale | Check to make the CinemachineCameras respond in real time to user input and damping, even if the game is running in slow motion. | |
World Up Override | The Y axis of the specified GameObject defines the worldspace up vector for CinemachineCameras. Use this property in top-down game environments. Set to None to use the worldspace Y axis. Setting this appropriately is important to avoid gimbal-lock in extreme up/down conditions. | |
Channel Mask | The CinemachineBrain will find the highest-priority CinemachineCamera that outputs to any of the channels selected. CinemachineCameras that do not output to one of these channels will be ignored. Normally, this value should be left at Default. Change it in situations where multiple CinemachineBrains are needed (for example, when implementing Split-screen). | |
Update Method | When to update the position and rotation of the CinemachineCameras. | |
Fixed Update | Synchronize CinemachineCamera update with the Physics module, in FixedUpdate. | |
Late Update | In MonoBehaviour LateUpdate. | |
Smart Update | Update each CinemachineCamera according to how its target is updated. This is the recommended setting. | |
Manual Update | CinemachineCameras do not update automatically. You must explicitly call brain.ManualUpdate() at an appropriate time in your game loop. This should be after any camera LookAt or Follow targets have moved. This is an advanced feature. |
|
Blend Update Method | When to resolve the blends and update the main camera. | |
Late Update | In MonoBehaviour LateUpdate. This is the recommended setting. | |
Fixed Update | Use this setting only if your Update Method is FixedUpdate and you see judder when blending. | |
Lens Mode Override | When enabled, CM camras are permitted to override the camera's lens mode (Perspective vs Orthographic vs Physical). | |
Default Mode | When Lens Mode Override is enabled and there is no CinemachineCamera actively overriding the lens mode, this lens mode will be pushed to the camera. | |
None | If Lens Override Mode is enabled and Default Mode is set to None, there will be no default mode pushed to the Camera when the CinemachineCamera is not overriding the lens mode. This setting is not recommended, because it can produce unpredictable results. It's always best to have a default mode. | |
Orthographic | Sets the Projection property to Orthographic. | |
Perspective | Sets the Projection property to Perspective and disables the Physical Camera feature and properties. | |
Physical | Sets the Projection property to Perspective and enables the Physical Camera feature and properties. | |
Default Blend | The blend to use when you haven’t explicitly defined a blend between two CinemachineCameras. | |
Cut | Zero-length blend. | |
Ease In Out | S-shaped curve, giving a gentle and smooth transition. | |
Ease In | Linear out of the outgoing shot, and easy into the incoming. | |
Ease Out | Easy out of the outgoing shot, and linear into the incoming. | |
Hard In | Easy out of the outgoing, and hard into the incoming. | |
Hard Out | Hard out of the outgoing, and easy into the incoming. | |
Linear | Linear blend. Mechanical-looking. | |
Custom | Custom blend curve. Draw the curve you want. | |
Custom Blends | The asset that contains custom settings for blends between specific CinemachineCameras in your Scene. | |
Create Asset | Create an asset containing a list of custom blends between CinemachineCameras. | |
Camera Cut Event | This event fires when a CinemachineCamera goes live and there is no blend. | |
Camera Activated Event | This event fires when a CinemachineCamera goes live. If a blend is involved, then the event fires on the first frame of the blend. |