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
Inherited Members
Namespace: Unity.Cinemachine
Syntax
[AddComponentMenu("Cinemachine/Procedural/Position Control/Cinemachine Orbital Follow")]
[CameraPipeline(CinemachineCore.Stage.Body)]
[HelpURL("https://docs.unity.cn/Packages/com.unity.cinemachine@3.0/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 |
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 |
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 |
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 |
|---|---|
| Single |
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 |
|---|---|
| Boolean |
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 |
|---|---|
| Single | Highest damping setting in this component |
Overrides
MutateCameraState(ref CameraState, Single)
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 |
| Single | 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, Single)
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 |
| Single | deltaTime | Delta time for time-based effects (ignore if less than or equal to 0) |
Returns
| Type | Description |
|---|---|
| Boolean | True if the vcam should do an internal update as a result of this call |
Overrides
Explicit Interface Implementations
CinemachineFreeLookModifier.IModifiableDistance.Distance
Declaration
float CinemachineFreeLookModifier.IModifiableDistance.Distance { get; set; }
Returns
| Type | Description |
|---|---|
| Single |
Implements
CinemachineFreeLookModifier.IModifiablePositionDamping.PositionDamping
Declaration
Vector3 CinemachineFreeLookModifier.IModifiablePositionDamping.PositionDamping { get; set; }
Returns
| Type | Description |
|---|---|
| Vector3 |
Implements
CinemachineFreeLookModifier.IModifierValueSource.NormalizedModifierValue
Declaration
float CinemachineFreeLookModifier.IModifierValueSource.NormalizedModifierValue { get; }
Returns
| Type | Description |
|---|---|
| Single |
Implements
IInputAxisOwner.GetInputAxes(List<IInputAxisOwner.AxisDescriptor>)
Report the available input axes
Declaration
void IInputAxisOwner.GetInputAxes(List<IInputAxisOwner.AxisDescriptor> axes)
Parameters
| Type | Name | Description |
|---|---|---|
| List<IInputAxisOwner.AxisDescriptor> | axes | Output list to which the axes will be added |
Implements
IInputAxisResetSource.HasResetHandler
Inspector checks this and displays warning if no handler
Declaration
bool IInputAxisResetSource.HasResetHandler { get; }
Returns
| Type | Description |
|---|---|
| Boolean |
Implements
IInputAxisResetSource.RegisterResetHandler(Action)
Register a handler that will be called when input needs to be reset
Declaration
void IInputAxisResetSource.RegisterResetHandler(Action handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | handler | The handler to register |
Implements
IInputAxisResetSource.UnregisterResetHandler(Action)
Unregister a handler that will be called when input needs to be reset
Declaration
void IInputAxisResetSource.UnregisterResetHandler(Action handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | handler | The handler to unregister |