docs.unity3d.com
    Show / Hide Table of Contents

    Class SplineAnimate

    A component to animate an object along a spline.

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    SplineComponent
    SplineAnimate
    Inherited Members
    SplineComponent.GetAxis(SplineComponent.AlignAxis)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    MonoBehaviour.CancelInvoke(String)
    MonoBehaviour.IsInvoking(String)
    MonoBehaviour.StartCoroutine(String)
    MonoBehaviour.StartCoroutine(String, Object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(String)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(Object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, Boolean)
    Component.GetComponentInParent(Type)
    UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(String)
    Component.SendMessageUpwards(String, Object, SendMessageOptions)
    Component.SendMessageUpwards(String, Object)
    Component.SendMessageUpwards(String)
    Component.SendMessageUpwards(String, SendMessageOptions)
    Component.SendMessage(String, Object)
    Component.SendMessage(String)
    Component.SendMessage(String, Object, SendMessageOptions)
    Component.SendMessage(String, SendMessageOptions)
    Component.BroadcastMessage(String, Object, SendMessageOptions)
    Component.BroadcastMessage(String, Object)
    Component.BroadcastMessage(String)
    Component.BroadcastMessage(String, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, Boolean)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.ToString()
    Object.name
    Object.hideFlags
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.Splines
    Syntax
    [AddComponentMenu("Splines/Spline Animate")]
    public class SplineAnimate : SplineComponent

    Properties

    Alignment

    The way the object should align when animating along the Spline. See SplineAnimate.AlignmentMode for details.

    Declaration
    public SplineAnimate.AlignmentMode Alignment { get; set; }
    Property Value
    Type Description
    SplineAnimate.AlignmentMode

    AnimationMethod

    The method used to traverse the Spline. See SplineAnimate.Method for details.

    Declaration
    public SplineAnimate.Method AnimationMethod { get; set; }
    Property Value
    Type Description
    SplineAnimate.Method

    Container

    The target container of the splines to follow.

    Declaration
    public SplineContainer Container { get; set; }
    Property Value
    Type Description
    SplineContainer

    Duration

    The time (in seconds) it takes to traverse the Spline once.

    Declaration
    public float Duration { get; set; }
    Property Value
    Type Description
    Single
    Remarks

    When animation method is set to Time this setter will set the Duration value and automatically recalculate MaxSpeed, otherwise, it will have no effect.

    Easing

    Easing mode used when animating the object along the Spline. See SplineAnimate.EasingMode for details.

    Declaration
    public SplineAnimate.EasingMode Easing { get; set; }
    Property Value
    Type Description
    SplineAnimate.EasingMode

    ElapsedTime

    Total time (in seconds) since the start of Spline's traversal.

    Declaration
    public float ElapsedTime { get; set; }
    Property Value
    Type Description
    Single

    IsPlaying

    Returns true if object is currently animating along the Spline.

    Declaration
    public bool IsPlaying { get; }
    Property Value
    Type Description
    Boolean

    Loop

    The way the Spline should be looped. See SplineAnimate.LoopMode for details.

    Declaration
    public SplineAnimate.LoopMode Loop { get; set; }
    Property Value
    Type Description
    SplineAnimate.LoopMode

    MaxSpeed

    The maxSpeed speed (in Unity units/second) that the Spline traversal will advance in.

    Declaration
    public float MaxSpeed { get; set; }
    Property Value
    Type Description
    Single
    Remarks

    If SplineAnimate.EasingMode is to None then the Spline will be traversed at MaxSpeed throughout its length. Otherwise, the traversal speed will range from 0 to MaxSpeed throughout the Spline's length depending on the easing mode set. When animation method is set to Speed this setter will set the MaxSpeed value and automatically recalculate Duration, otherwise, it will have no effect.

    NormalizedTime

    Normalized time of the Spline's traversal. The integer part is the number of times the Spline has been traversed. The fractional part is the % (0-1) of progress in the current loop.

    Declaration
    public float NormalizedTime { get; set; }
    Property Value
    Type Description
    Single

    ObjectForwardAxis

    Object space axis that should be considered as the object's forward vector.

    Declaration
    public SplineComponent.AlignAxis ObjectForwardAxis { get; set; }
    Property Value
    Type Description
    SplineComponent.AlignAxis

    ObjectUpAxis

    Object space axis that should be considered as the object's up vector.

    Declaration
    public SplineComponent.AlignAxis ObjectUpAxis { get; set; }
    Property Value
    Type Description
    SplineComponent.AlignAxis

    PlayOnAwake

    If true, transform will automatically start following the target Spline on awake.

    Declaration
    public bool PlayOnAwake { get; set; }
    Property Value
    Type Description
    Boolean

    StartOffset

    Normalized distance [0;1] offset along the spline at which the object should be placed when the animation begins.

    Declaration
    public float StartOffset { get; set; }
    Property Value
    Type Description
    Single

    Methods

    Pause()

    Pause object's animation along the Spline.

    Declaration
    public void Pause()

    Play()

    Begin animating object along the Spline.

    Declaration
    public void Play()

    Restart(Boolean)

    Stop the animation and place the object at the beginning of the Spline.

    Declaration
    public void Restart(bool autoplay)
    Parameters
    Type Name Description
    Boolean autoplay

    If true, the animation along the Spline will start over again.

    Update()

    Evaluates the animation along the Spline based on deltaTime.

    Declaration
    public void Update()

    Events

    Updated

    Invoked each time object's animation along the Spline is updated.

    Declaration
    public event Action<Vector3, Quaternion> Updated
    Event Type
    Type Description
    Action<Vector3, Quaternion>
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023