I want to stop all other animations that are playing, but it won’t work
if v:IsA("AnimationTrack") then
if v.IsPlaying == true then
v:Stop()
end
end
I want to stop all other animations that are playing, but it won’t work
if v:IsA("AnimationTrack") then
if v.IsPlaying == true then
v:Stop()
end
end
Show the rest of the code please, specifically what v is
https://developer.roblox.com/en-us/api-reference/property/AnimationTrack/IsPlaying
That is exactly how you would do it.
If you’re looping through the game descendants, this wont work, AnimationTracks aren’t the same with Animations
, they can’t be found parented under a character(or pretty much everywhere as I am aware of). Instead you should store all the animation tracks inside an array when you load them so you’re able to manage them later:
local animationTracks = {}
--somewhere in your code
local track = Humanoid:LoadAnimation(animation)
table.insert(animationTracks, track)
--when managing them
for _, track in pairs(animationTracks) do
if track.IsPlaying then
track:Stop()
end
end