AnimationPlayer

Back to reference

Makes playing and loading tracks into a humanoid easy

Members

Functions

Returns Functions Description
AnimationPlayer.new ( Humanoid Humanoid ) Constructs a new animation player

Methods

Returns Methods Description
WithAnimation ( Animation ) Adds an animation to use
AddAnimation ( Name AnimationId ) Adds an animation to play
GetTrack ( TrackName ) Returns a track in the player
PlayTrack ( string TrackName number FadeTime = 0.4 number Weight = 1 number Speed = 1 number StopFadeTime = 0.4 ) Plays a track
AnimationTrack StopTrack ( string TrackName number FadeTime = 0.4 ) Stops a track from being played
StopAllTracks ( FadeTime ) Stops all tracks playing

Functions Descriptions

AnimationPlayer.new ( Humanoid Humanoid )

Constructs a new animation player

Parameters

Methods Descriptions

AnimationPlayer:WithAnimation ( Animation )

Adds an animation to use

Parameters

  • Animation

AnimationPlayer:AddAnimation ( Name AnimationId )

Adds an animation to play

Parameters

  • Name
  • AnimationId

AnimationPlayer:GetTrack ( TrackName )

Returns a track in the player

Parameters

  • TrackName

AnimationPlayer:PlayTrack ( string TrackName number FadeTime = 0.4 number Weight = 1 number Speed = 1 number StopFadeTime = 0.4 )

Plays a track

Parameters

  • string TrackName: Name of the track to play
  • number FadeTime = 0.4: How much time it will take to transition into the animation.
  • number Weight = 1: Acts as a multiplier for the offsets and rotations of the playing animation This parameter is extremely unstable. Any parameter higher than 1.5 will result in very shaky motion, and any parameter higher ' than 2 will almost always result in NAN errors. Use with caution.
  • number Speed = 1: The time scale of the animation.
    Setting this to 2 will make the animation 2x faster, and setting it to 0.5 will make it run 2x slower.
  • number StopFadeTime = 0.4

AnimationTrack AnimationPlayer:StopTrack ( string TrackName number FadeTime = 0.4 )

Stops a track from being played

Parameters

Returns

AnimationPlayer:StopAllTracks ( FadeTime )

Stops all tracks playing

Parameters

  • FadeTime