Problem with custom enemy

Hello, why does this not work (code in sss)

local freddy = game.Workspace.GlamrockFreddy
local anim = freddy.Humanoid.Animator:LoadAnimation(script.Animation):Play()

local pfs = game:GetService("PathfindingService")
local pth = pfs:CreatePath()

pth:ComputeAsync(freddy.HumanoidRootPart.Position, game.Workspace.Part.Position)

for i, pathpoint in pairs(pth:GetWaypoints()) do
	freddy.Humanoid:MoveTo(pathpoint.Position)
end

video:
https://gyazo.com/12087f722b865c97bd6ab541db851524

Ensure that none of the parts in the enemy are anchored.

Maybe try adding a wait after the MoveTo (I dont deal with NPCs much, so it may yield. I dont think it does though)

1 Like