Hello,
This issue is really stupid. I don’t know what I’m missing but I’ve looked at these 5 or so lines for a couple of hours now.
local Eanims = {}
for _, anim in enemyModel.animations:GetChildren() do
Eanims[anim.Name] = enemyModel.AnimationController:LoadAnimation(anim)
end
print(#Eanims)
The last line prints 0 no matter what. The for loop can correctly print anim.Name and it sees all animations I want to add. The loop runs the correct number of times too, printing each animation’s name. If I just try to play the loaded animation in the loop it works too. The only issue is this stupid Eanims table.
I even tried table.insert just to see what would happen and it told me I couldn’t change a readonly table, so something I did might have made it think that it’s read only. This is in a localscript.