Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i get ROBLOX animations to work on an NPC?

Asked by 9 years ago

I have all required settings for an NPC, i've gotten it to spawn but when i run an anim on it, it doesn't work. It just stands there. When i try to script an anim in it that is. I've triple checked the links for the animations i've made and everything (and yes i've used a server script) and it still doesn't work.

0
Script? RM0d 305 — 9y

2 answers

Log in to vote
4
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

You really need to do your research before asking questions! If you would have read the Animations article on the Roblox wiki, you would have found a very helpful section on NPC animations. Quoting it shall suffice for an answer;

"Loading an animation into a Non-Player Character (or NPC) is almost the exact same as loading it into a Player Character. The main difference is that instead of loading the animation into a Humanoid part contained in the model, instead a NPC's animation should be loaded into an AnimationController. An Animation Controller can be added into the model through Insert Basic Object > AnimationController or in a script via Instance.new("AnimationController"). Note that the model still has to have a part called HumanoidRootPart (even if the model doesn't contain a Humanoid object).

Loading the animation into an AnimationController [creates] an AnimationTrack which can then be played:

local animController = Instance.new("AnimationController")
local animTrack = animController:LoadAnimation(animation)
animTrack:Play()

Non-Player Character animations should be played from a server Script."

Ad
Log in to vote
1
Answered by 6 years ago

For this to happen you don't need the animation controller mostly the humanoid first, because mostly the humanoid DOES work but it would take hours for approaching that same code.

0
Ok ehm heres how it works actually Humanoid:LoadAnimation(HumanoidParent) Animescapetower 10 — 6y

Answer this question