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

How do I make MoveTo use an NPC's walk animation?

Asked by 5 years ago

I have a walk animation for my npc that is already there. When I use MoveTo

script.Parent.Humanoid:MoveTo(target.Position, target)

the NPC walks with it's idle animation playing. How do I fix this?

1 answer

Log in to vote
2
Answered by 4 years ago
Edited 4 years ago
  1. Play the game in studio
  2. Go to workspace and find your character model
  3. Find the child in your character model named "Animate"
  4. Right click and copy "Animate" or Click on it and press shortcut on keyboard cmd+c if Mac or ctrl+c if Windows
  5. Stop game
  6. Paste "Animate" into NPC model
  7. Create a new server script ("script" NOT "localscript") inside NPC model
  8. Name the new script "Animate"
  9. Open "Animate" and select all
  10. Paste text of "Animate" into the new script
  11. Copy all children of "Animate" into the new "Animate" script
  12. Delete the localscript "Animate" and its children
  13. Open new "Animate" script and delete section for chat emote since NPC won't use chat and there will be an error that player is nil because NPC is not a player
  14. Go to the children of "Animate" and open the desired animation you want
  15. Copy and Paste in the desired animation URL or AssetID into the animations When the NPC walks or jumps or do other actions, it will be using the animations in "Animate"
-----------[[Get Rid of This in the "Animate" script, located towards the end of the script]]-------------
game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
    local emote = ""
    if (string.sub(msg, 1, 3) == "/e ") then
        emote = string.sub(msg, 4)
    elseif (string.sub(msg, 1, 7) == "/emote ") then
        emote = string.sub(msg, 8)
    end

    if (pose == "Standing" and emoteNames[emote] ~= nil) then
        playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
    end
end)
0
Make sure NPC's Humanoid is same rig type as animations and NPC body parts are the correct parts and names for that specific rig type. Ex. r6 or r15; Torso or UpperTorso; Right Arm or RightHand; etc. karinavaaj 22 — 4y
0
Yeah I'm sorry, but I solved this a long time ago I forgot I posted this on the forum but I'll still accept your answer. Thanks anyways! songboy50 77 — 4y
0
Thanks. This is how I get my NPC to walk normally like the real players and climbing ladders, too. I would like to know how you do yours. karinavaaj 22 — 4y
Ad

Answer this question