We use cookies on this site to enhance your user experience

Stop Playing Animations

Stop Playing Animations

Sep 07 2018, 4:38 AM PST

The code below gets a list of the AnimationTrack|AnimationTracks current being played for the Players/LocalPlayer|localplayer using the Humanoid/GetPlayingAnimationTracks function. Then, the code iterates through the list and stops all of the tracks using the AnimationTrack/Stop function.

local Players = game:GetService("Players")

local localPlayer = Players.LocalPlayer

if not localPlayer.Character then

local humanoid = localPlayer.Character:WaitForChild("Humanoid")

-- Get playing animations
local AnimationTracks = humanoid:GetPlayingAnimationTracks()

-- Stop all playing animations
for i, track in pairs (AnimationTracks) do