Animation length returns 0

I noticed that in a bunch of my scripts that when I try to use animation length it would always return 0. I don’t know why that’s happening

local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://16395251868"

local FW = humanoid:LoadAnimation(anim)

local duration = FW.Length

print(duration)

This is the code I was using to test if it would return 0 in a new script. I tried with multiple animations and they all returned 0

Perhaps the animation is not loaded immediately. Just to test this, try waiting a second before printing FW.Length.

I’ve tried that. It still returns 0.