Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Add animations to my NPC? [STILL UNANSWERED]


local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=241586474"
local animController = script.Parent.AnimationController

if script.Parent.Humanoid.Health <= 50 then

local animTrack = animController:LoadAnimation(animation)
animTrack:Play()

end

This is the script I have so far, I know how to add animations into the player but not NPCs and this script isnt working for me. I dont know if its the script thats the problem on the children of the npc. The script is a child of the NPC I also have an AnimationController and a HumanoidRootpart.

please help meh.

2 comments

1
0

Thanks for the help everyone

2 answers

A list of things you want to make sure of when creating an NPC with Animations:

  1. There is a humanoid (And check if there's an Animator inside the humanoid, I'm not sure if that changes anything)

  2. The Animations are loaded into the humanoid (If it still doesn't work after referring to this, load the animations to the Animator in the Humanoid)

  3. In the Torso, there are 5 Motor6Ds. Left Hip, Left Shoulder, Neck, Right Hip, and Right Shoulder. - You may have this one wrong.

  4. There is a humanoidRootPart.

  5. The Animation you are playing is owned by you.

  6. The Animation you are playing isn't being overrun by another animation (This refers to the priority)

This discussion is preserved as it was. New answers, comments, and votes are closed.