Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to stop all playing animations?

Asked by 4 years ago
local Humanoid = game.Players.LocalPlayer.Character.Humanoid
local ActiveTracks = Humanoid:GetPlayingAnimationTracks()
for _,v in pairs(ActiveTracks) do
    v:Stop()
end

Works, but one of my looped idle animations doesn't stop. Is there a fix?

3 answers

Log in to vote
0
Answered by 4 years ago

https://scriptinghelpers.org/questions/42820/is-there-a-way-to-stop-all-animations

It Might be a replication of this.

0
That's the script I'm using. Same problem. Did you even read my code? DejaSketch 84 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Change all your custom animations' priorities to Action.

Maybe the problem is not from this code.

Change the priority by this:

local AnimationTrack = Humanoid:LoadAnimation(Your animation here)
AnimationTrack.Priority = Enum.AnimationPriority.Action
AnimationTrack:Play()--Then play it
0
When I said Idle I didn't mean the animation priority. It's been at Action, it's just looped and when I run my code, the looped animation wouldn't stop. DejaSketch 84 — 4y
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local Humanoid = game.Players.LocalPlayer.Character.Humanoid
local ActiveTracks = Humanoid:GetPlayingAnimationTracks()
for _,v in pairs(ActiveTracks) do
    v:Stop() -- Stop animationTrack
    v.Looped = false -- Disable loop
end
0
All this code does is stop any animation once it starts playing, breaking my code. The problem from my original code was that if a looped animation was playing, it wouldn't stop. DejaSketch 84 — 4y

Answer this question