Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Animation not stopping?

I've tried stopping an animation, but it just doesn't work. It keeps on saying "Stop is not a valid member of Animation.", and I use ":Stop" for a variable, yet it still doesn't work. Here's the code:

script.Parent.Parent.Unequipped:connect(function()
	local anim = script.Parent.Animation
anim:Stop()
end)

Please help.

2 comments

0

Are you sure the Animation is named 'Animation'? Does that variable's path lead to the animation?

0

Yes, the animation's name is "Animation".

2 answers

Well, the way you're doing it is incorrect. To play an Animation, you load it to the humanoid. So, since this is another script, I recommend making the anim variable in the animation playing script global _G.anim. That way, you can access it in this script and put _G.anim:Stop().

2 comments

0

It still doesn't work... it says "Stop isn't a valid member of Animation".

0

Are you sure you're putting :Stop() not .Stop()?

This discussion is preserved as it was. New answers, comments, and votes are closed.