[SOLVED] Animation script is broken after an update! i need help

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().

1 Like

This function is deprecated in favor of using Animator:LoadAnimation() directly (the Animator may be created while editing or at runtime).

image

moving the mobanimation script to starterplayerscripts did not give a result

please who can help me? i can pay for it! bump

we are still didnt solved. please help. bump

read this clearly


also is the animation your’s, if not, then that’s probably the issue

1 Like

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

it seems like you did not read my question correctly

it doesn’t work with my or not my animation

on the serverside the animations works fine, but i need to animate mobs only clientside

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)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.