local collector = game:GetService("CollectionService")
workspace.DescendantAdded:Connect(function(des)
if collector:HasTag(des,"AI") then
print("NewZombie")
local NewThread = coroutine.create(function()
local Anim = des.Zombie:LoadAnimation(script.Animation)
print("2")
while wait(1) do
print("Cycle")
if des.Zombie.MoveDirection.Magnitude > 0 then
print("run")
local SpeedFactor = des.Zombie.WalkSpeed / 16
Anim:AdjustSpeed(SpeedFactor)
if Anim.IsPlaying ~= true then
Anim:Play()
end
else
print("stop")
if Anim.IsPlaying ~= false then
Anim:Stop()
end
end
end
end)
coroutine.resume(NewThread)
end
end)
When I remove the LoadAnimation and all the rest about it, the script works fine and it prints 2.
When I put the LoadAnimation back, it only prints NewZombie and no 2.
I suggest you try loading it into the Animator instead of a Humanoid, assuming “Zombie” is the Humanoid, as there was been a recent change which deprecated this and it’s better to use the new method. (change: Deprecating LoadAnimation on Humanoid and AnimationController)
I’ve been using the same exact method for making animations for a set of zombies, the MoveDirection was not working so I ended up in taking a default animation script and changing the IDs before activating it.
I am experiencing the same issue. Have you found the solution yet?
EDIT: I know, came too late, but still, maybe someone knows how to solve this and will answer this message, which can help people who find this in future