Animation:Stop() not working

local Animation = Instance.new("Animation", plr.Character)
local Humanoid = plr.Character:WaitForChild("Humanoid")
Animation.AnimationId = "rbxassetid://6549269819"
Animate = Humanoid:LoadAnimation(Animation)
Animate.Looped = false

 function emote()
    	if emoting == false then
    		emoting = true
    		Animate:Play()
    		plr.CameraMode = Enum.CameraMode.Classic
    		Humanoid.WalkSpeed = 0
    		Humanoid.JumpPower = 0
    		controls:Disable()
    		togglevis()
    		Animate.Stopped:Wait() -- Wait until animation ends
    		controls:Enable()
    		Animate:Stop()
    		Humanoid.WalkSpeed = 30
    		Humanoid.JumpPower = 20
    		plr.CameraMode = Enum.CameraMode.LockFirstPerson
    		emoting = false
    		togglevis()
    end
 end

When animation ends Humanoid.WalkSpeed = 30 and below works fine
except Animate:Stop() it’s not working how to fix that?

1 Like

Why would it work if it’s after a Animate.Stopped event? The way you did it was to wait for the animation to stop, then to stop it?

1 Like

oh yeah but wait why script below Animate.Stopped:Wait() works while animation is still continue playing forever thats weird

You have the animation looped I presume?

1 Like

no i didnt its below the Animate = Humanoid:LoadAnimation(Animation)