Class CinemachineSplineDolly
A Cinemachine Camera Body component that constrains camera motion to a Spline. The camera can move along the spline.
This behaviour can operate in two modes: manual positioning, and Auto-Dolly positioning. In Manual mode, the camera's position is specified by animating the Spline Position field. In Auto-Dolly mode, the Spline Position field is animated automatically every frame by finding the position on the spline that's closest to the camera's tracking target.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[AddComponentMenu("Cinemachine/Procedural/Position Control/Cinemachine Spline Dolly")]
[DisallowMultipleComponent]
[CameraPipeline(CinemachineCore.Stage.Body)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineSplineDolly.html")]
public class CinemachineSplineDolly : CinemachineComponentBase
Fields
AutomaticDolly
Controls how automatic dolly occurs
Declaration
[FoldoutWithEnabledButton("Enabled")]
[Tooltip("Controls how automatic dolly occurs. A tracking target may be necessary to use this feature.")]
public SplineAutoDolly AutomaticDolly
Field Value
Type | Description |
---|---|
SplineAutoDolly |
CameraRotation
How to set the camera's rotation and Up. This will affect the screen composition.
Declaration
[Tooltip("How to set the camera's rotation and Up. This will affect the screen composition, because the camera Aim behaviours will always try to respect the Up direction.")]
[FormerlySerializedAs("CameraUp")]
public CinemachineSplineDolly.RotationMode CameraRotation
Field Value
Type | Description |
---|---|
CinemachineSplineDolly.RotationMode |
Damping
Settings for controlling damping, which causes the camera to move gradually towards the desired spline position
Declaration
[FoldoutWithEnabledButton("Enabled")]
[Tooltip("Settings for controlling damping, which causes the camera to move gradually towards the desired spline position")]
public CinemachineSplineDolly.DampingSettings Damping
Field Value
Type | Description |
---|---|
CinemachineSplineDolly.DampingSettings |
SplineOffset
Where to put the camera relative to the spline position. X is perpendicular to the spline, Y is up, and Z is parallel to the spline.
Declaration
[Tooltip("Where to put the camera relative to the spline position. X is perpendicular to the spline, Y is up, and Z is parallel to the spline.")]
public Vector3 SplineOffset
Field Value
Type | Description |
---|---|
Vector3 |
SplineSettings
Holds the Spline container, the spline position, and the position unit type
Declaration
public SplineSettings SplineSettings
Field Value
Type | Description |
---|---|
SplineSettings |
Properties
CameraPosition
The position along the spline at which the camera will be placed. This can be animated directly, or set automatically by the Auto-Dolly feature to get as close as possible to the Follow target. The value is interpreted according to the Position Units setting.
Declaration
public float CameraPosition { get; set; }
Property Value
Type | Description |
---|---|
float |
IsValid
True if component is enabled and has a spline
Declaration
public override bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
PositionUnits
How to interpret the Spline Position: - Distance: Values range from 0 (start of Spline) to Length of the Spline (end of Spline). - Normalized: Values range from 0 (start of Spline) to 1 (end of Spline). - Knot: Values are defined by knot indices and a fractional value representing the normalized interpolation between the specific knot index and the next knot."
Declaration
public PathIndexUnit PositionUnits { get; set; }
Property Value
Type | Description |
---|---|
PathIndexUnit |
Spline
The Spline container to which the camera will be constrained.
Declaration
public SplineContainer Spline { get; set; }
Property Value
Type | Description |
---|---|
SplineContainer |
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
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 that 0, no damping is done. |
Overrides
OnEnable()
Called when the behaviour is enabled.
Declaration
protected override void OnEnable()