Animation of custom model does not play at all?

So this is the character I’m trying to animate currently
Having tried 5 different scripts with the same function, none of them work. I have tried changing the properties of the RootPart, Head, etc.

CHARACTER INFO

The character I want to animate

Character Body Parts
31%20PM

When I test the game on studio, the character falls onto the ground and the animation does not play.

Current code is from Roblox Wiki

local anim = Instance.new("Animation")

anim.AnimationId = "rbxassetid://3162773549"

local animController = Instance.new("AnimationController", script.Parent)

local animTrack = animController:LoadAnimation(kickAnimation)

anim:Play()

If you would like to have more info about the character, please say so.

Try using this code for animation:

local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local dance = humanoid:LoadAnimation(animation)
dance:Play()

Make sure to insert the script into the model and then in the script add an animation to it. Like so,

animator

Then add the animation link into Animationid.

id

This should solve your problem. Hope it helped!

1 Like

Thanks for helping out. When you are putting code in forums, it’s best to format it all in so people can directly copy + paste it. You can format it like this:
In:
```
– code
```

Out:

-- code
1 Like

Finally! The animation plays! Couldn’t thank you enought(ik its a very simple thing but this made my dayy)