Class CinemachineOrbitalFollow
This is a CinemachineComponent in the the Body section of the component pipeline. Its job is to position the camera somewhere on a spheroid centered at the Follow target.
The position on the sphere and the radius of the sphere can be controlled by user input.
Inheritance
Implements
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[AddComponentMenu("Cinemachine/Procedural/Position Control/Cinemachine Orbital Follow")]
[DisallowMultipleComponent]
[CameraPipeline(CinemachineCore.Stage.Body)]
[RequiredTarget(RequiredTargetAttribute.RequiredTargets.Tracking)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineOrbitalFollow.html")]
public class CinemachineOrbitalFollow : CinemachineComponentBase, IInputAxisOwner, IInputAxisResetSource, CinemachineFreeLookModifier.IModifierValueSource, CinemachineFreeLookModifier.IModifiablePositionDamping, CinemachineFreeLookModifier.IModifiableDistance
Fields
HorizontalAxis
Axis representing the current horizontal rotation. Value is in degrees and represents a rotation about the up vector
Declaration
[Tooltip("Axis representing the current horizontal rotation. Value is in degrees and represents a rotation about the up vector.")]
public InputAxis HorizontalAxis
Field Value
Type | Description |
---|---|
InputAxis |
OrbitStyle
How to construct the surface on which the camera will travel
Declaration
[Tooltip("Defines the manner in which the orbit surface is constructed.")]
public CinemachineOrbitalFollow.OrbitStyles OrbitStyle
Field Value
Type | Description |
---|---|
CinemachineOrbitalFollow.OrbitStyles |
Orbits
Defines a complex surface rig from 3 horizontal rings.
Declaration
[Tooltip("Defines a complex surface rig from 3 horizontal rings.")]
public Cinemachine3OrbitRig.Settings Orbits
Field Value
Type | Description |
---|---|
Cinemachine3OrbitRig.Settings |
RadialAxis
Axis controlling the scale of the current distance. Value is a scalar multiplier and is applied to the specified camera distance
Declaration
[Tooltip("Axis controlling the scale of the current distance. Value is a scalar multiplier and is applied to the specified camera distance.")]
public InputAxis RadialAxis
Field Value
Type | Description |
---|---|
InputAxis |
Radius
The camera will be placed at this distance from the Follow target
Declaration
[Tooltip("The camera will be placed at this distance from the Follow target.")]
public float Radius
Field Value
Type | Description |
---|---|
float |
RecenteringTarget
Defines the reference frame for horizontal recentering. The axis center will be dynamically updated to be behind the selected object.
Declaration
[Tooltip("Defines the reference frame for horizontal recentering. The axis center will be dynamically updated to be behind the selected object.")]
public CinemachineOrbitalFollow.ReferenceFrames RecenteringTarget
Field Value
Type | Description |
---|---|
CinemachineOrbitalFollow.ReferenceFrames |
TargetOffset
Offset from the object's center in local space.
Use this to fine-tune the orbit when the desired focus of the orbit is not
the tracked object's center
Declaration
[Tooltip("Offset from the target object's center in target-local space. Use this to fine-tune the orbit when the desired focus of the orbit is not the tracked object's center.")]
public Vector3 TargetOffset
Field Value
Type | Description |
---|---|
Vector3 |
TrackerSettings
Settings to control damping for target tracking.
Declaration
public TrackerSettings TrackerSettings
Field Value
Type | Description |
---|---|
TrackerSettings |
VerticalAxis
Axis representing the current vertical rotation. Value is in degrees and represents a rotation about the right vector
Declaration
[Tooltip("Axis representing the current vertical rotation. Value is in degrees and represents a rotation about the right vector.")]
public InputAxis VerticalAxis
Field Value
Type | Description |
---|---|
InputAxis |
Properties
IsValid
True if component is enabled and has a valid Follow target
Declaration
public override bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Stage
Get the Cinemachine Pipeline stage that this component implements. Always returns the Body stage
Declaration
public override CinemachineCore.Stage Stage { get; }
Property Value
Type | Description |
---|---|
CinemachineCore.Stage |
Overrides
Methods
ForceCameraPosition(Vector3, Quaternion)
Force the virtual camera to assume a given position and orientation
Declaration
public override void ForceCameraPosition(Vector3 pos, Quaternion rot)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | pos | World-space position to take |
Quaternion | rot | World-space orientation to take |
Overrides
GetMaxDampTime()
Report maximum damping time needed for this component.
Declaration
public override float GetMaxDampTime()
Returns
Type | Description |
---|---|
float | Highest damping setting in this component |
Overrides
MutateCameraState(ref CameraState, float)
Positions the virtual camera according to the transposer rules.
Declaration
public override void MutateCameraState(ref CameraState curState, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
CameraState | curState | The current camera state |
float | deltaTime | Used for damping. If less than 0, no damping is done. |
Overrides
OnTargetObjectWarped(Transform, Vector3)
This is called to notify the user that a target got warped, so that we can update its internal state to make the camera also warp seamlessly.
Declaration
public override void OnTargetObjectWarped(Transform target, Vector3 positionDelta)
Parameters
Type | Name | Description |
---|---|---|
Transform | target | The object that was warped |
Vector3 | positionDelta | The amount the target's position changed |
Overrides
OnTransitionFromCamera(ICinemachineCamera, Vector3, float)
Notification that this virtual camera is going live. Base class implementation does nothing.
Declaration
public override bool OnTransitionFromCamera(ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
ICinemachineCamera | fromCam | The camera being deactivated. May be null. |
Vector3 | worldUp | Default world Up, set by the CinemachineBrain |
float | deltaTime | Delta time for time-based effects (ignore if less than or equal to 0) |
Returns
Type | Description |
---|---|
bool | True if the vcam should do an internal update as a result of this call |