Class CinemachineSplineSmoother
This behaviour can be attached to a GameObject with a SplineContainer.
It proivdes a function to apply smoothing to the spline.
Smoothing auto-adjusts the knot tangents to maintain second-order smoothness of the spline, making it suitable
for camera paths.
Smoothing is costly, because the entire path has to be considered when adjusting each knot.
In Editor mode, an option is provided to automatically smooth the spline whenever it is modified.
In runtime mode, smoothing must be invoked manually by calling SmoothSplineNow().
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[ExecuteAlways]
[AddComponentMenu("Cinemachine/Helpers/Cinemachine Spline Smoother")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineSplineSmoother.html")]
[RequireComponent(typeof(SplineContainer))]
public class CinemachineSplineSmoother : MonoBehaviour
Fields
AutoSmooth
If checked, the spline will be automatically smoothed whenever it is modified.
Declaration
[Tooltip("If checked, the spline will be automatically smoothed whenever it is modified (editor only).")]
public bool AutoSmooth
Field Value
Type | Description |
---|---|
bool |
Methods
SmoothSplineNow()
Apply smoothing to the spline.
Knot settings will be adjusted to produce second-order smoothness of the path, making it
suitable for use as a camera path.
This is an expensive operation. Use with caution.
Declaration
public void SmoothSplineNow()