You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to animate the spawning Mobs and placed Towers on the client.
- What is the issue? Include screenshots / videos if possible!
The Animation wont show up.
- 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