So I’m working on a port of my friend’s game, and I want do very simple animation tables which don’t require that much effort. So, let me explain a scene
the character’s root part contains animation tracks, I want these animation tracks to be organized into a table in a format like this
for i,v in pairs(stand.StandHumanoidRootPart:GetChildren()) do
if v:IsA("AnimationTrack") then
table.insert(Animations,tostring(v), Player.Character.Humanoid:LoadAnimation(v))
end
end
You should use character.Humanoid.Animator:LoadAnimation() instead of character:LoadAnimation()
and the way to do this is have an animations table with all the anim instances and then load them with a for loop like this
local animTable = {"GroundSmash" = tool.Animations["GroundSmash"]}
function LoadAnimations(animator,animTable)
local AnimTracks = {}
for i,v in pairs(animTable:GetChildren()) do
AnimTracks[v.Name] = animator:LoadAnimation(v)
end
return AnimTracks
end
local AnimTracks = LoadAnimations(char.Humanoid.Animator,animTable)
print(AnimTracks)