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:
1 | script.Parent.Parent.Unequipped:connect( function () |
2 | local anim = script.Parent.Animation |
3 | anim:Stop() |
4 | end ) |
Please help.
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()
.