Why doesn't my animation play when the tool is activated?
I am trying to play an animation with a tool whenever that tool has been activated. When I try, my animation never plays.
1 | local plr = game:GetService( "Players" ).LocalPlayer |
2 | local char = plr.Character or plr.CharacterAdded:Wait() |
3 | local h = char:WaitForChild( "Humanoid" ) |
4 | local anim = h:LoadAnimation(script.Parent:WaitForChild( "Animation" )) |
6 | script.Parent.Activated:connect( function () |
This code is Local Script in a tool in the starter pack
The animation is a child of the tool and has an ID
The animation is 1 second long
The animations priority is set to [Action]