NPC walking animation won't stop

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Make a NPC walk, with the animation.
    (I got the npc from testing a game in roblox studio then copying/pasting it into the studio)

  2. What is the issue? I can’t get the animation to stop

--heres a snippet of code from a module placed in replicated storage
local module = {}

function module:WalkToPart(character,part,anim) 
   local hrp = character:FindFirstChild("HumanoidRootPart")
   if not character:FindFirstChild("HumanoidRootPart") then return end
   if not anim:IsA("Animation") then return end
   
   local Animation = character.Humanoid:LoadAnimation(anim)   
   Animation:Play() 
   character.Humanoid.WalkToPoint = part.Position

end

return module
-- with a walk animation placed inside
local m = require(game.ReplicatedStorage.Animate)

m:WalkToPart(script.Parent,workspace.Part,script.WalkAnim)

I thought character.Humanoid.WalkToPoint = part.Position would yield the script but It didn’t.

Nvm, I figured it out.

For future reference can you say how you fixed it?

3 Likes

I used

Animation:Play()
Humanoid:MoveTo(position,block)
Humanoid.MoveToFinished:Connect(function() Animation:Stop() end)
4 Likes