Animation does not stop

I have a weapon system that uses animations for everything. All animations work and stop fine except for the worldmodel firing animations, seen below:

The animations used in the viewmodel and the worldmodel are the same. The viewmodel firing animation can stop normally, but the worldmodel one can’t. It keeps playing as if it was looped, and causes conflicts with other weapon animations.

  • No, the worldmodel animation isn’t looped.
  • Yes, the priorities are higher than default animations.
  • Yes, I stop the animations, even with loops to make sure.

Code responsible for playing animations:

while task.wait() do
	if Equipped then
		if Firing and not Debounce then
            --irrelevant stuff
			fire:Play()
			firevm:Play()	

            --irrelevant stuff
		else
			fire:Stop()
			if firevm then
				firevm:Stop()
			end	
		end
	else
		reload:Stop()
		fire:Stop()
		equip:Stop()
		idle:Stop()
	end
end

But no, the worldmodel animation doesn’t stop.
I’ve considered stopping all humanoid animations, but that’s just dumb.

I’d appreciate any sort of help.


EDIT: It seems all worldmodel animations are broken now.


EDIT 2: I’m aware there are multiple threads about animations not stopping, but none of those are similar to my problem. Mine is just built different, I guess. ¯\(°_o)/¯


EDIT 3: I tried setting the stopped animations’ weight to 0. No effect.

  • Animations aren’t affected by any external script of any means.
  • The animations aren’t the same as other weapons.

I’m gonna try loading the worldmodel animations using the humanoid and see if that helps.


EDIT 4: Holy ####! I think I created indestructible animations! There is no actual goddamn way to stop any of these!


5 Likes

Not sure if this will work but you can try:

local Equipped = false
local Firing = false
local Debounce = false

local function PlayFireAnimations()
    -- Play the animations if the tool is equipped and firing
    if Equipped and Firing and not Debounce then
        fire:Play()
        if firevm then
            firevm:Play()
        end
    else
        -- Pause the animations if not firing or tool not equipped
        fire:Pause()
        if firevm then
            firevm:Pause()
        end
    end
end

while task.wait() do
    PlayFireAnimations()
end
3 Likes

Animations don’t have a :Pause() method mate. I’ve replaced them with :Stop(), but the same thing is still happening.

If you want to pause an animation, btw, just do animationTrack:AdjustSpeed(0)

1 Like

That is just a temporary solution for the firing animation, but it won’t work for other animations. I probably didn’t realize this, but all the animations fail to stop now.

(UPDATED: DIDNT SEE THE LOOP OFF).

I recommend that you create a named event inside the animation and check when its called. Here is the documentation from ROBLOX for using events, and the documentation for creating events.

2 Likes

Shame on me, fellas.
These schizophrenic animations weren’t stopping because they are set to loop in the animation editor. (though I don’t know why they kept looping even after I set AnimationTrack.Looped to false, probably because the animation instances are in server and tracks are local.)

All thanks to @anythingoliver, without them telling me to add events to my animations I would’ve never found the issue.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.