Animation not playing

Animation not playing
I`ve tried placing the same animation on the rig and it worked (or maybe it worked because it was serverscript?)

local tool = script.Parent
local plr = tool.Parent.Parent
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild('Humanoid')
tool.Activated:Connect(function()
	hum.Animator:LoadAnimation(script.pickswing):Play()
end)

pickswing animation is in the script
image

serverscript for the rig (i copied pickswing to the workspace)

wait(3)
script.Parent.Humanoid.Animator:LoadAnimation(workspace.pickswing):Play()

when i load in game and use the tool nothing happens neither in the game nor in the output tab
what i need is to play animation when the tool activates

2 Likes

It’s not a good way to use LoadAnimation function in every event called; use it only once and just play it as this example code:

local animationTrack = hum.Animator:LoadAnimation(script.pickswing)
tool.Activated:Connect(function()
	animationTrack:Play()
end)
2 Likes

i did this at first but then i changed it to my variant because i thought it will solve the problem
anyways i`m still looking for the solution

1 Like

Does the event fire in the first place?

1 Like

yes, i inserted print() into the function and it worked

Then, how about giving it some delays?

Try loading a different animation ID and see if it works… Maybe its the animation???

i told you that the animation worked on rig
both the player and the rig are r6

Doesn’t hurt to swap to a different random animation

i switched my pickaxe swing animation to roblox`s default sword attack animation and it worked so i guess the issue was with the animation

TURNS OUT THIS DOESNT SOLVE BEING UNABLE TO USE R6 ANIMATIONS
if you`re having the same trouble do the same:

instead of turning on r6 there


(this will only turn on/off animation packs, i`m too blind to notice)

you should turn on r6 there:

I`m still not used to new studio design