Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Stop idle and run animations from playing after tool is unequipped?

Asked by 4 years ago
Edited 4 years ago

If you scroll down and look for the unequipped function, that's the part that doesn't work. When I unequip my tool the idle and run animations should stop, but they still play.

Heres a short video of me unequipping it, idk how to use gyazo that well https://gyazo.com/104197d47e30d4cc1c155023619c7dd8

01--Variables
02humanoid = script.Parent.Parent.Humanoid
03 
04Running = script.Parent.Running
05Idle = script.Parent.Idle
06Attack = script.Parent.Attack
07 
08--Loads animations
09runAnim = humanoid:LoadAnimation(Running)
10idleAnim = humanoid:LoadAnimation(Idle)
11attackAnim = humanoid:LoadAnimation(Attack)
12 
13--Animation locations
14lookForIdle = script.Parent.Idle
15lookForRun = script.Parent.Running
View all 50 lines...
0
I am sorry to disappoint you but I can figure it out, bud. rabbi99 714 — 4y
0
:/ User#29785 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

The problem is that when you're telling the animation to stop, you are tell the actual animation object and not the animation loaded in a humanoid. It should be fixed below.

also sorry I replied late.

01--Variables
02humanoid = script.Parent.Parent.Humanoid
03 
04Running = script.Parent.Running
05Idle = script.Parent.Idle
06Attack = script.Parent.Attack
07 
08--Loads animations
09runAnim = humanoid:LoadAnimation(Running)
10idleAnim = humanoid:LoadAnimation(Idle)
11attackAnim = humanoid:LoadAnimation(Attack)
12 
13--Animation locations
14lookForIdle = script.Parent.Idle
15lookForRun = script.Parent.Running
View all 50 lines...
0
I already tried to do the idleAnim:Stop() and runAnim:Stop(), but it still doesn't disable the animations when I unequip my tool, idk why User#29785 0 — 4y
Ad

Answer this question