CinemachineFreeLook Class

Cinemachine

CinemachineFreeLook Class

A Cinemachine Camera geared towards a 3rd person camera experience. The camera orbits around its subject with three separate camera rigs defining rings around the target. Each rig has its own radius, height offset, composer, and lens settings. Depending on the camera's position along the spline connecting these three rigs, these settings are interpolated to give the final camera position and state.
Inheritance Hierarchy
SystemObject  Object
    Component
      Behaviour
        MonoBehaviour
          CinemachineCinemachineVirtualCameraBase
            CinemachineCinemachineFreeLook

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

Type.createClass(
	'Cinemachine.CinemachineFreeLook',
	Cinemachine.CinemachineVirtualCameraBase);

The CinemachineFreeLook type exposes the following members.

Constructors
  NameDescription
Public methodCinemachineFreeLook
Top
Properties
  NameDescription
Public propertyDescription
Gets a brief debug description of this virtual camera, for use when displayiong debug info
(Inherited from CinemachineVirtualCameraBase.)
Public propertyFollow
Get the current Follow target. Returns parent's Follow if parent is non-null and no specific Follow defined for this camera
(Overrides CinemachineVirtualCameraBaseFollow.)
Public propertyLiveChildOrSelf
Returns the rig with the greatest weight
(Overrides CinemachineVirtualCameraBaseLiveChildOrSelf.)
Public propertyLookAt
Get the current LookAt target. Returns parent's LookAt if parent is non-null and no specific LookAt defined for this camera
(Overrides CinemachineVirtualCameraBaseLookAt.)
Public propertyName
Get the name of the Virtual Camera. Base implementation returns the owner GameObject's name.
(Inherited from CinemachineVirtualCameraBase.)
Public propertyParentCamera
Support for meta-virtual-cameras. This is the situation where a virtual camera is in fact the public face of a private army of virtual cameras, which it manages on its own. This method gets the VirtualCamera owner, if any. Private armies are implemented as Transform children of the parent vcam.
(Inherited from CinemachineVirtualCameraBase.)
Public propertyPreviousStateIsValid
Set this to force the next update to ignore deltaTime and reset itself
(Inherited from CinemachineVirtualCameraBase.)
Public propertyPriority
Get the Priority of the virtual camera. This determines its placement in the CinemachineCore's queue of eligible shots.
(Inherited from CinemachineVirtualCameraBase.)
Public propertyStatic memberRigNames
Names of the 3 child rigs
Public propertyState
The cacmera state, which will be a blend of the child rig states
(Overrides CinemachineVirtualCameraBaseState.)
Public propertyValidatingStreamVersion
Version that was last streamed, for upgrading legacy
(Inherited from CinemachineVirtualCameraBase.)
Public propertyVirtualCameraGameObject
The GameObject owner of the Virtual Camera behaviour.
(Inherited from CinemachineVirtualCameraBase.)
Top
Methods
  NameDescription
Public methodAddPostPipelineStageHook
A delegate to hook into the state calculation pipeline. This will be called after each pipeline stage, to allow others to hook into the pipeline. See CinemachineCore.Stage.
(Inherited from CinemachineVirtualCameraBase.)
Public methodGetLocalPositionForCameraFromInput
Returns the local position of the camera along the spline used to connect the three camera rigs. Does not take into account the current heading of the camera (or its target)
Public methodGetRig
Get a child rig
Protected methodInvokePostPipelineStageCallback
Invokes the PostPipelineStageDelegate for this camera, and up the hierarchy for all parent cameras (if any).
(Inherited from CinemachineVirtualCameraBase.)
Public methodIsLiveChild
Check whether the vcam a live child of this camera. Returns true if the child is currently contributing actively to the camera state.
(Overrides CinemachineVirtualCameraBaseIsLiveChild(ICinemachineCamera).)
Public methodMoveToTopOfPrioritySubqueue
When multiple virtual cameras have the highest priority, there is sometimes the need to push one to the top, making it the current Live camera if it shares the highest priority in the queue with its peers. This happens automatically when a new vcam is enabled: the most recent one goes to the top of the priority subqueue. Use this method to push a vcam to the top of its priority peers. If it and its peers share the highest priority, then this vcam will become Live.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodOnDestroy
Makes sure that the child rigs get destroyed in an undo-firndly manner. Invalidates the rig cache.
(Overrides CinemachineVirtualCameraBaseOnDestroy.)
Protected methodOnDisable
Base class implementation makes sure the priority queue remains up-to-date.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodOnEnable
Updates the child rig cache
(Overrides CinemachineVirtualCameraBaseOnEnable.)
Protected methodOnTransformParentChanged
Base class implementation makes sure the priority queue remains up-to-date.
(Inherited from CinemachineVirtualCameraBase.)
Public methodOnTransitionFromCamera
If we are transitioning from another FreeLook, grab the axis values from it.
(Overrides CinemachineVirtualCameraBaseOnTransitionFromCamera(ICinemachineCamera).)
Protected methodOnValidate
Enforce bounds for fields, when changed in inspector.
(Overrides CinemachineVirtualCameraBaseOnValidate.)
Public methodPreUpdateChildCameras
This is called prior to the updating of the vcam's child cameras, in order to allow the parent to prepare its children. If the children are updating on FixedUpdate, then this will not necessarily be called prior to every FixedUpdate, but might be called on LateUpdate. This implementation pushes the axis values to the rigs.
(Overrides CinemachineVirtualCameraBasePreUpdateChildCameras(Vector3, Single).)
Public methodRemovePostPipelineStageHook
Remove a Pipeline stage hook callback. Make sure it is removed from all the children.
(Overrides CinemachineVirtualCameraBaseRemovePostPipelineStageHook(CinemachineVirtualCameraBaseOnPostPipelineStageDelegate).)
Protected methodResolveFollow
Returns this vcam's Follow target, or if that is null, will retrun the parent vcam's Follow target.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodResolveLookAt
Returns this vcam's LookAt target, or if that is null, will retrun the parent vcam's LookAt target.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodStart
Base class implementation does nothing.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodUpdate
Base class implementation makes sure the priority queue remains up-to-date.
(Inherited from CinemachineVirtualCameraBase.)
Public methodUpdateCameraState
Called by CinemachineCore at designated update time so the vcam can position itself and track its targets. All 3 child rigs are updated, and a blend calculated, depending on the value of the Y axis.
(Overrides CinemachineVirtualCameraBaseUpdateCameraState(Vector3, Single).)
Top
Fields
  NameDescription
Public fieldCinemachineGUIDebuggerCallback
This is deprecated. It is here to support the soon-to-be-removed Cinemachine Debugger in the Editor.
(Inherited from CinemachineVirtualCameraBase.)
Public fieldStatic memberCreateRigOverride
Override component pipeline creation. This needs to be done by the editor to support Undo. The override must do exactly the same thing as the CreatePipeline method in this class.
Public fieldStatic memberDestroyRigOverride
Override component pipeline destruction. This needs to be done by the editor to support Undo.
Public fieldm_BindingMode
The coordinate space to use when interpreting the offset from the target
Public fieldm_CommonLens
If enabled, this lens setting will apply to all three child rigs, otherwise the child rig lens settings will be used
Public fieldm_ExcludedPropertiesInInspector
Inspector control - Use for hiding sections of the Inspector UI.
(Inherited from CinemachineVirtualCameraBase.)
Public fieldm_Follow
Object for the camera children wants to move with (the body target)
Public fieldm_Heading
The definition of Forward. Camera will follow behind
Public fieldm_Lens
Specifies the lens properties of this Virtual Camera. This generally mirrors the Unity Camera's lens settings, and will be used to drive the Unity camera when the vcam is active
Public fieldm_LockStageInInspector
Inspector control - Use for enabling sections of the Inspector UI.
(Inherited from CinemachineVirtualCameraBase.)
Public fieldm_LookAt
Object for the camera children to look at (the aim target)
Public fieldm_Orbits
The radius and height of the three orbiting rigs
Public fieldm_Priority
The priority will determine which camera becomes active based on the state of other cameras and this camera. Higher numbers have greater priority.
(Inherited from CinemachineVirtualCameraBase.)
Public fieldm_RecenterToTargetHeading
Controls how automatic recentering of the X axis is accomplished
Public fieldm_SplineCurvature
Public fieldm_XAxis
The Horizontal axis. Value is 0..359. This is passed on to the rigs' OrbitalTransposer component
Public fieldm_YAxis
The Vertical axis. Value is 0..1. Chooses how to blend the child rigs
Protected fieldOnPostPipelineStage
A delegate to hook into the state calculation pipeline. Implementaion must be sure to call this after each pipeline stage, to allow other services to hook into the pipeline. See CinemachineCore.Stage.
(Inherited from CinemachineVirtualCameraBase.)
Top
See Also