local Bun = script.Parent
local Humanoid = Bun:WaitForChild('Humanoid')
local Animator = Bun:WaitForChild('AnimationController'):WaitForChild('Animator')
local RootPart = Bun:WaitForChild('HumanoidRootPart')
local AnimFolder = Humanoid:WaitForChild('Animations')
local Animations = {}
for i, Animation in AnimFolder:GetChildren() do
local Anim = Animator:LoadAnimation(Animation)
table.insert(Animations, Anim)
end
function GetAnimation(Animation)
for i, v in Animations do
if v.Name == Animation then
return v
end
end
return 'Idle'
end
GetAnimation('Idle'):Play()
print('IdleAnimation?')
no error is given, but the animation does not play. The output is only the print statement at the end.
Sometimes animations won’t play when played the first time as they need to be fully loaded. Try running the function twice. Confirm that GetAnimation is returning an AnimationTrack and check all its properties to verify it’s the instance you’re looking for.