hello,
so i am making a melee weapon and when the swing animation finishes i want to switch it to the idle animation.
The snippet of code:
local humanoid = plr.Character:FindFirstChildWhichIsA("Humanoid")
local animsList = anims:GetChildren()
local randomAnim = humanoid:LoadAnimation(animsList[math.random(1, #animsList)])
randomAnim:Play()
hitbox:HitStart()
local pl = humanoid:GetPlayingAnimationTracks()
for i, g in pl do
if g.Name == "Idle" then
g:Stop()
end
end
randomAnim.Ended:Connect(function()
if isEquipped() then
local idleAnimation = humanoid:LoadAnimation(tool.IdleAnims.Idle)
idleAnimation:Play()
end
end)
What is the issue? Is it that i need to make it another anim priority?
But whats the issue? Well this: https://gyazo.com/1f5029cc27f4044aa9b820e91c830f3c
It finishes the anim, then wants to go to the default animation then snaps back to my idle animation, why is that?
(yes i tried: idleAnimation:Play(0) )