docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class AnimationTrack

    A Timeline track used for playing back animations on an Animator.

    Inheritance
    object
    Object
    ScriptableObject
    PlayableAsset
    TrackAsset
    AnimationTrack
    Implements
    IPlayableAsset
    IPropertyPreview
    ISerializationCallbackReceiver
    ILayerable
    Inherited Members
    TrackAsset.m_Clips
    TrackAsset.start
    TrackAsset.end
    TrackAsset.duration
    TrackAsset.muted
    TrackAsset.mutedInHierarchy
    TrackAsset.timelineAsset
    TrackAsset.parent
    TrackAsset.GetClips()
    TrackAsset.isEmpty
    TrackAsset.hasClips
    TrackAsset.hasCurves
    TrackAsset.isSubTrack
    TrackAsset.GetChildTracks()
    TrackAsset.curves
    TrackAsset.locked
    TrackAsset.lockedInHierarchy
    TrackAsset.supportsNotifications
    TrackAsset.CreateCurves(string)
    TrackAsset.CreateTrackMixer(PlayableGraph, GameObject, int)
    TrackAsset.CreatePlayable(PlayableGraph, GameObject)
    TrackAsset.CreateDefaultClip()
    TrackAsset.CreateClip<T>()
    TrackAsset.DeleteClip(TimelineClip)
    TrackAsset.CreateMarker(Type, double)
    TrackAsset.CreateMarker<T>(double)
    TrackAsset.DeleteMarker(IMarker)
    TrackAsset.GetMarkers()
    TrackAsset.GetMarkerCount()
    TrackAsset.GetMarker(int)
    TrackAsset.CreatePlayable(PlayableGraph, GameObject, TimelineClip)
    TrackAsset.CanCreateTrackMixer()
    TrackAsset.GetAnimationClipHash(AnimationClip)
    TrackAsset.OnBeforeTrackSerialize()
    TrackAsset.OnAfterTrackDeserialize()
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    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, bool)
    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, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Timeline
    Assembly: Unity.Timeline.dll
    Syntax
    [Serializable]
    [TrackClipType(typeof(AnimationPlayableAsset), false)]
    [TrackBindingType(typeof(Animator))]
    [ExcludeFromPreset]
    public class AnimationTrack : TrackAsset, IPlayableAsset, IPropertyPreview, ISerializationCallbackReceiver, ILayerable

    Properties

    applyAvatarMask

    Specifies whether to apply the AvatarMask to the track.

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

    applyOffsets

    Specifies whether to apply track offsets to all clips on the track.

    Declaration
    [Obsolete("applyOffset is deprecated. Use trackOffset instead", true)]
    public bool applyOffsets { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    This can be used to offset all clips on a track, in addition to the clips individual offsets.

    avatarMask

    Specifies the AvatarMask to be applied to all clips on the track.

    Declaration
    public AvatarMask avatarMask { get; set; }
    Property Value
    Type Description
    AvatarMask
    Remarks

    Applying an AvatarMask to an animation track will allow discarding portions of the animation being applied on the track.

    eulerAngles

    The euler angle representation of the rotation offset of the entire track.

    Declaration
    public Vector3 eulerAngles { get; set; }
    Property Value
    Type Description
    Vector3

    inClipMode

    Specifies whether the Animation Track has clips, or is in infinite mode.

    Declaration
    public bool inClipMode { get; }
    Property Value
    Type Description
    bool

    infiniteClip

    An AnimationClip storing the data for an infinite track.

    Declaration
    public AnimationClip infiniteClip { get; }
    Property Value
    Type Description
    AnimationClip
    Remarks

    The value of this property is null when the AnimationTrack is in Clip Mode.

    infiniteClipOffsetEulerAngles

    The euler angle representation of the rotation offset of the track when in infinite mode.

    Declaration
    public Vector3 infiniteClipOffsetEulerAngles { get; set; }
    Property Value
    Type Description
    Vector3

    infiniteClipOffsetPosition

    The translation offset of a track in infinite mode.

    Declaration
    public Vector3 infiniteClipOffsetPosition { get; set; }
    Property Value
    Type Description
    Vector3

    infiniteClipOffsetRotation

    The rotation offset of a track in infinite mode.

    Declaration
    public Quaternion infiniteClipOffsetRotation { get; set; }
    Property Value
    Type Description
    Quaternion

    infiniteClipPostExtrapolation

    The saved state of post-extrapolation for clips when converted to infinite mode.

    Declaration
    public TimelineClip.ClipExtrapolation infiniteClipPostExtrapolation { get; set; }
    Property Value
    Type Description
    TimelineClip.ClipExtrapolation

    infiniteClipPreExtrapolation

    The saved state of pre-extrapolation for clips converted to infinite mode.

    Declaration
    public TimelineClip.ClipExtrapolation infiniteClipPreExtrapolation { get; set; }
    Property Value
    Type Description
    TimelineClip.ClipExtrapolation

    matchTargetFields

    Specifies which fields to match when aligning offsets of clips.

    Declaration
    public MatchTargetFields matchTargetFields { get; set; }
    Property Value
    Type Description
    MatchTargetFields

    outputs

    Returns a description of the PlayableOutputs that will be created by this track.

    Declaration
    public override IEnumerable<PlayableBinding> outputs { get; }
    Property Value
    Type Description
    IEnumerable<PlayableBinding>
    Overrides
    TrackAsset.outputs

    position

    The translation offset of the entire track.

    Declaration
    public Vector3 position { get; set; }
    Property Value
    Type Description
    Vector3

    rotation

    The rotation offset of the entire track, expressed as a quaternion.

    Declaration
    public Quaternion rotation { get; set; }
    Property Value
    Type Description
    Quaternion

    trackOffset

    Specifies what is used to set the starting position and orientation of an Animation Track.

    Declaration
    public TrackOffset trackOffset { get; set; }
    Property Value
    Type Description
    TrackOffset
    Remarks

    Track Offset is only applied when the Animation Track contains animation that modifies the root Transform.

    Methods

    CalculateItemsHash()

    Returns a hash which is combination of hashes from clips, animation clips and marker times.

    Declaration
    protected override int CalculateItemsHash()
    Returns
    Type Description
    int

    The hash value.

    Overrides
    TrackAsset.CalculateItemsHash()
    Remarks

    Overloads TrackAsset.CalculateItemsHash() and combines its returned value with the hash from the infinite clip.

    CreateClip(AnimationClip)

    Creates a TimelineClip on this track that uses an AnimationClip.

    Declaration
    public TimelineClip CreateClip(AnimationClip clip)
    Parameters
    Type Name Description
    AnimationClip clip

    Source animation clip of the resulting TimelineClip.

    Returns
    Type Description
    TimelineClip

    A new TimelineClip which has an AnimationPlayableAsset asset attached.

    CreateInfiniteClip(string)

    Creates an AnimationClip that stores the data for an infinite track.

    Declaration
    public void CreateInfiniteClip(string infiniteClipName)
    Parameters
    Type Name Description
    string infiniteClipName

    The name of the AnimationClip to create. This method does not ensure unique names. If you want a unique clip name, you must provide one. See ObjectNames.GetUniqueName for information on a method that creates unique names.

    Remarks

    If an infiniteClip already exists, this method produces no result, even if you provide a different value for infiniteClipName. This method can't create an infinite clip for an AnimationTrack that contains one or more Timeline clips. Use AnimationTrack.inClipMode to determine whether it is possible to create an infinite clip on an AnimationTrack. When used from the editor, this method attempts to save the created infinite clip to the TimelineAsset. The TimelineAsset must already exist in the AssetDatabase to save the infinite clip. If the TimelineAsset does not exist, the infinite clip is still created but it is not saved.

    CreateRecordableClip(string)

    Creates a TimelineClip, AnimationPlayableAsset and an AnimationClip. Use this clip to record in a timeline.

    Declaration
    public TimelineClip CreateRecordableClip(string animClipName)
    Parameters
    Type Name Description
    string animClipName

    The name of the AnimationClip to create. This method does not ensure unique names. If you want a unique clip name, you must provide one. See ObjectNames.GetUniqueName for information on a method that creates unique names.

    Returns
    Type Description
    TimelineClip

    Returns a new TimelineClip with an AnimationPlayableAsset asset attached.

    Remarks

    When used from the editor, this method attempts to save the created recordable clip to the TimelineAsset. The TimelineAsset must already exist in the AssetDatabase to save the recordable clip. If the TimelineAsset does not exist, the recordable clip is still created but it is not saved.

    GatherProperties(PlayableDirector, IPropertyCollector)

    Called by the Timeline Editor to gather properties requiring preview.

    Declaration
    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
    Parameters
    Type Name Description
    PlayableDirector director

    The PlayableDirector invoking the preview

    IPropertyCollector driver

    PropertyCollector used to gather previewable properties

    Overrides
    TrackAsset.GatherProperties(PlayableDirector, IPropertyCollector)

    OnCreateClip(TimelineClip)

    Used to initialize default values on a newly created clip

    Declaration
    protected override void OnCreateClip(TimelineClip clip)
    Parameters
    Type Name Description
    TimelineClip clip

    The clip added to the track

    Overrides
    TrackAsset.OnCreateClip(TimelineClip)

    Implements

    IPlayableAsset
    IPropertyPreview
    ISerializationCallbackReceiver
    ILayerable

    Extension Methods

    TrackAssetExtensions.GetGroup(TrackAsset)
    TrackAssetExtensions.SetGroup(TrackAsset, GroupTrack)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)