Animation wont show up when played

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want to animate the spawning Mobs and placed Towers on the client.

  1. What is the issue? Include screenshots / videos if possible!

The Animation wont show up.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve been looking since yesterday but couldnt find any solutions

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

The Mobs are created by the server and moved by tweening to the next waypoint. I want to animate them on the client to reduce lagging and stuff.




local function playAnim (Object, Anim)
	local AnimationController = Object:WaitForChild("AnimationController")
	local AnimFolder = Object:WaitForChild("Animations")
	
	if AnimationController and AnimFolder then
		local AnimExists = AnimFolder:WaitForChild(Anim)
		
		if AnimExists then
			local Animator = AnimationController:FindFirstChild("Animator") or Instance.new("Animator", AnimationController)
			
			local Track = Animator:LoadAnimation(AnimExists)
			
			while Track.Length <= 0 do task.wait(0.5) end
			
			print("playing")
			Track:Play()
		end
	end
	
end


workspace.Enemies.ChildAdded:Connect(function(Object)
	
	playAnim(Object, "Walk")
	
end)

workspace.Towers.ChildAdded:Connect(function(Object)
	
	playAnim(Object, "Idle")
	
end)

Hope someone can help me :wink:

I though AnimationController was deprecated, isn’t Animator under Humanoid?

i put the Animator under the Humanoid but it still doesnt work

I found the solution . I had to delet the AnimationController of the Object

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