CinemachineBrain Class

Cinemachine

CinemachineBrain Class

CinemachineBrain is the link between the Unity Camera and the Cinemachine Virtual Cameras in the scene. It monitors the priority stack to choose the current Virtual Camera, and blend with another if necessary. Finally and most importantly, it applies the Virtual Camera state to the attached Unity Camera. The CinemachineBrain is also the place where rules for blending between virtual cameras are defined. Camera blending is an interpolation over time of one virtual camera position and state to another. If you think of virtual cameras as cameramen, then blending is a little like one cameraman smoothly passing the camera to another cameraman. You can specify the time over which to blend, as well as the blend curve shape. Note that a camera cut is just a zero-time blend.
Inheritance Hierarchy
SystemObject  Object
    Component
      Behaviour
        MonoBehaviour
          CinemachineCinemachineBrain

Namespace:  Cinemachine
Assembly:  Cinemachine (in Cinemachine.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
[DocumentationSortingAttribute(0f, DocumentationSortingAttributeLevel.UserRef)]
[ExecuteInEditMode]
[DisallowMultipleComponent]
[AddComponentMenu("Cinemachine/CinemachineBrain")]
[SaveDuringPlayAttribute]
public class CinemachineBrain : MonoBehaviour
Cinemachine.CinemachineBrain = function();

Type.createClass(
	'Cinemachine.CinemachineBrain',
	UnityEngine.MonoBehaviour);

The CinemachineBrain type exposes the following members.

Constructors
  NameDescription
Public methodCinemachineBrain
Top
Properties
  NameDescription
Public propertyActiveBlend
Get the current blend in progress. Returns null if none.
Public propertyActiveVirtualCamera
Get the current active virtual camera.
Public propertyCurrentCameraState
The current state applied to the unity camera (may be the result of a blend)
Public propertyDefaultWorldUp
Get the default world up for the virtual cameras.
Public propertyIsBlending
Is there a blend in progress?
Public propertyOutputCamera
Get the Unity Camera that is attached to this GameObject. This is the camera that will be controlled by the brain.
Public propertyStatic memberSoloCamera
API for the Unity Editor. Show this camera no matter what. This is static, and so affects all Cinemachine brains.
Top
Methods
  NameDescription
Public methodStatic memberGetSoloGUIColor
API for the Unity Editor.
Public methodIsLive
True if the ICinemachineCamera the current active camera, or part of a current blend, either directly or indirectly because its parents are live.
Top
Fields
  NameDescription
Public fieldm_CameraActivatedEvent
This event will fire whenever a virtual camera goes live. If a blend is involved, then the event will fire on the first frame of the blend
Public fieldm_CameraCutEvent
This event will fire whenever a virtual camera goes live and there is no blend
Public fieldm_CustomBlends
This is the asset which contains custom settings for specific blends.
Public fieldm_DefaultBlend
The blend which is used if you don't explicitly define a blend between two Virtual Cameras.
Public fieldm_IgnoreTimeScale
When enabled, the cameras will always respond in real-time to user input and damping, even if the game is running in slow motion
Public fieldm_ShowCameraFrustum
When enabled, shows the camera's frustum in the scene view.
Public fieldm_ShowDebugText
When enabled, the current camera and blend will be indicated in the game window, for debugging.
Public fieldm_UpdateMethod
Depending on how the target objects are animated, adjust the update method to minimize the potential jitter. Use FixedUpdate if all your targets are animated with for RigidBody animation. SmartUpdate will choose the best method for each virtual camera, depending on how the target is animated.
Public fieldm_WorldUpOverride
If set, this object's Y axis will define the worldspace Up vector for all the virtual cameras. This is useful in top-down game environments. If not set, Up is worldspace Y.
Top
See Also