Anim Not Playing on NPC

Hello, DevForum.

So, I want to cleanly loop an Animation on a NPC, but the animation isn’t playing. This is probably an easy fix right in front of my nose, but I cannot see the answer. Here is the script:

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

image

(ignore the “pot”)

The NPC has a Humanoid. The animation was created using Moon Editor.

is the animation a variable? if not you should make it, for example

local animation = script.Animation

put this at the beggining of your script and it should work

3 Likes

Try Using AnimationController: AnimationController | Documentation - Roblox Creator Hub
And Then use this code:

AnimationContoller:LoadAnimation(animation)

Oh, sorry. Typo when I was making the post. Yes, I have that.

Would I add this as a variable?

Y’all are goofballs.

Just unanchor your entire model, then anchor the HumanoidRootPart / PrimaryPart

1 Like

You are a legend, man. A simple mistake. Or this plugin is a culprit.
image

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.