Hi all, I’m trying to use the default Roblox wave animation from /e wave and use it in my game.
I’m loading an animation track and then running it; the track is set not to loop yet it still loops after it finishes infinitely.
Originally this only occurred when I published the game and tested it with other people. The animation was running in a local script so I’m assuming that it only stopped for the local player and nobody else (I noticed that playing an animation in a local script will run it for everyone). However, when I moved the stop method to a regular server-side script, it refused to stop even for my own character.
I’ve tried forcibly stopping the track, destroying it, but it refuses to stop itself after it runs. I’ve looked on numerous threads on this issue before but the key difference was that the other authors were using their own animation that they had uploaded to Roblox themselves. Many of them were able to fix this issue by changing the loop setting on the Animation Editor or by reuploading it. But since I am using a default Roblox animation, I am pretty much unable to do any of that.
Any help with this bug would be appreciated. I would like to know any workarounds or different ways I can play animations if any exist; I can’t imagine that other scripters had never had this problem for such a core part of a game’s experience.
local char = player.Character
local humanoid = char.Humanoid
local track = humanoid.Animator:LoadAnimation(animation)
track.Priority = Enum.AnimationPriority.Action4
track.Looped = false
local animations = humanoid:GetPlayingAnimationTracks()
for i, anim in pairs(animations) do
(Doing what exactly? Going to assume you mean track:Stop())
I did that previously, and it changed nothing. What I did notice however is that I believe that a different instance of a track appears when it loops after I tried running a print statement every time it stops, meaning that it stops once and does destroy itself, but somehow another instance of the animation is loading even though I never told it to.
Tried the second solution you put and running game:GetObjects() in a script isn’t possible, looking at the documentation. I can’t think of any alternatives to it (LoadAsset() does something completely different, yes? Don’t know why they would include it there…)
However, I just checked the server-side. It seems like the animation stopped there, but not on the client side…much like how running the animation in the client side stopped it for only the client side. I just tried firing a remote event to the client so it can stop the animation as well, but it’s unable to locate it for some reason, presumably because the parent is nil.