all the mobs in my game are animated via a local script and it always worked fine, until at one point today I came in Roblox studio and saw that the mobs were not animated! I started restoring old versions of the game in a panic, because I thought I had ruined everything, but even yesterday’s version of the game was broken. yesterday we played on the stream and all the animations worked perfectly. I don’t understand what’s going on. a roblox bug or I don’t understand what else could be wrong. the local script for animation has always been like this:
local function animateMob(mob)
local humanoid = mob:WaitForChild("Humanoid")
local animFolder = mob:WaitForChild("Animations")
if mob and animFolder then
local runAnim = animFolder:WaitForChild("RunAnim")
if runAnim then
local animator = humanoid:FindFirstChild("Animator")
local walkTrack = animator:LoadAnimation(runAnim)
walkTrack:Play()
walkTrack:AdjustSpeed(humanoid.WalkSpeed / 10) -- Adjust speed based on walkspeed
end
else
warn("No humanoid/animation folder for", mob.Name)
end
end
workspace.Map.Mobs.ChildAdded:Connect(animateMob)
and it has always been in startergui.
I also tried the standard server version of the animation with the same id of the running animation as in the local version and everything seems to work. id of the running animation: http://www.roblox.com/asset/?id=507767714
please help me how to fix it?
i dont know what this could be, but it maybe could be because youre using an animator in the humanoid when you dont need to. You can just use Humanoid:LoadAnimation().
its the global basic animation of running. until today, all animations worked, now no animation works. there are no errors in the console. when debugging breakpoints, all objects fall into variables
local function animateMob(mob)
local humanoid = mob:WaitForChild("Humanoid")
local animFolder = mob:WaitForChild("Animations")
if mob and animFolder then
local runAnim = animFolder:WaitForChild("RunAnim")
if runAnim then
local animator = humanoid:WaitForChild("Animator")
local walkTrack = animator:LoadAnimation(runAnim)
local tries = 0
while wait() and walkTrack.IsPlaying == false do
tries += 1
print("Trying to animate: "..tries)
walkTrack:Play()
walkTrack:AdjustSpeed(humanoid.WalkSpeed / 10) -- Adjust speed based on walkspeed
end
end
else
warn("No humanoid/animation folder for", mob.Name)
end
end
workspace.Map.Mobs.ChildAdded:Connect(animateMob)