Hello. I’m making a death animation, I loop through all the models in the workspace and then checking if they have a humanoid in them, if they do I play an animaiton which I’ve set, and it’s priority is on action. Also, all humanoids at the beginning are disabled ‘BreakJointsOnDeath’, but it still doesn’t work.
Here’s my code:
local function play_Animation(animationTrack)
animationTrack:Play()
end
local function call_Function()
for _, v in ipairs(workspace:GetChildren()) do
if v:IsA("Model") then
if v:FindFirstChild("Humanoid") then
local humanoid = v:FindFirstChild("Humanoid")
repeat wait()
until humanoid.Died:Wait()
local animation = script.DeathAnimation
local animationTrack = humanoid:LoadAnimation(animation)
play_Animation(animationTrack)
end
end
end
end
while wait() do
call_Function()
end
Edit: I found a solution already.