Class CinemachineSplineCart
This is a very simple behaviour that constrains its transform to a Spline.
It can be used to animate any objects along a path, or as a tracking target for
Cinemachine Cameras.
Implements
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[ExecuteAlways]
[DisallowMultipleComponent]
[AddComponentMenu("Cinemachine/Helpers/Cinemachine Spline Cart")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineSplineCart.html")]
public class CinemachineSplineCart : MonoBehaviour, ISplineReferencer
Fields
AutomaticDolly
Controls how automatic dollying occurs
Declaration
[FoldoutWithEnabledButton("Enabled")]
[Tooltip("Controls how automatic dollying occurs. A tracking target may be necessary to use this feature.")]
public SplineAutoDolly AutomaticDolly
Field Value
Type | Description |
---|---|
SplineAutoDolly |
TrackingTarget
Used only by Automatic Dolly settings that require it
Declaration
[Tooltip("Used only by Automatic Dolly settings that require it")]
public Transform TrackingTarget
Field Value
Type | Description |
---|---|
Transform |
UpdateMethod
When to move the cart, if Speed is non-zero
Declaration
[Tooltip("When to move the cart, if Speed is non-zero")]
public CinemachineSplineCart.UpdateMethods UpdateMethod
Field Value
Type | Description |
---|---|
CinemachineSplineCart.UpdateMethods |
Properties
PositionUnits
How to interpret PositionOnSpline: - 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 cart will be constrained.
Declaration
public SplineContainer Spline { get; set; }
Property Value
Type | Description |
---|---|
SplineContainer |
SplinePosition
The cart's current position on the spline, in spline position units
Declaration
public float SplinePosition { get; set; }
Property Value
Type | Description |
---|---|
float |
SplineSettings
Get a reference to the SplineSettings struct contained in this object.
Declaration
public ref SplineSettings SplineSettings { get; }
Property Value
Type | Description |
---|---|
SplineSettings | A reference to the embedded SplineSettings struct |