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

Animating an NPC With A Humanoid?[SOLVED]

Asked by 7 years ago
Edited 7 years ago

So I'm relatively new to lua; and brand new to Roblox's API. I was under the impression that NPCs could be animated via Animation Controllers if they did not contain Humanoids and Additionally that they could be animated the same manner as players are through the Humanoid; Assuming they contain one. This is in a LocalScript(I've Attempted A Server Script Also) in my Npc's Humanoid

local humanoid = game.workspace.Spearman.Humanoid
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://696772035"
local animTrack = humanoid:LoadAnimation(anim)
animTrack:Play()

When I go to run the test; the NPC remains in his frozen positon; He's unanchored; but I have his body positioned with CFrame also(If That matters) Additionally, He has a tool Equipped from the ReplicatedStorage(Also not sure if its relevant)

There are no Errors or warnings in the Output or Script Analysis Windows either

Could someone tell me what I'm missing?

0
It has to be a server script. It can't be a local script unless it's connected to the client(The player) Local scripts are meant for functions that deal with the player and the server not the server alone. MapleGalaxy 8 — 7y
0
It doesn't work in a server script either(I'm assuming you meant a server script as in a child of the Humanoid still) ReedGhost 2 — 7y
0
Find a freemodel of an Animated NPC and try to figure out what works. Validark 1580 — 7y

Answer this question