How do I get an animation track from humanoid?

Hello, so basically I made 2 animations and I want to load them into tracks before I start coding them. Here’s my code.

local players = game:GetService("Players")
local player = players.LocalPlayer
print(player.Name)
local character = player.Character or player.CharacterAdded:Wait()
print(character)
local humanoid = character:FindFirstChild("Humanoid")
local leftPunchAnim = 18652692794
local leftPunchTrack = humanoid:LoadAnimation(leftPunchAnim)
local rightPunchAnim = 18652711566
local rightPunchTrack = humanoid:LoadAnimation(rightPunchAnim)

But I get this error:


I have 0 idea what this means, does anyone know?

You are setting your leftPunchAnim variable to a number not an animation id or anything

Besides the animator only accepts Animation Instances

Try creating an animation instance and pasting the animation into its properties. After that refrence the instance in your script and use as the argument to :LoadAnimation()

3 Likes

oops i forgot about that (10k iq moment)

1 Like

where would I parent the animation?

sorry im bad at animating so im much noob

1 Like

Doesn’t matter where as long as you can reference it in the script.

The easiest would be under the script I guess,
other alternative is folder called “Animations” in replicated storage or sum

ok first error is gone but do you know what this is?

Never encountered that, although I see that you are loading the animation directly from the humanoid. It actually has Animator instance inside of it

Try

humanoid.Animator:LoadAnimation()

Maybe that’ll work

If the game works fine then it might just be a [studio bug]"Property "Animator.EvaluationThrottled" is not currently enabled" when printing a Model - #3 by JoyfulFlowerMary)

still the same error, maybe M100 is correct…

1 Like