Pathfining AI stops too early

So what I am trying to achieve is a dummy which moves to the player until a bool value is not set to false, I am having the target of the AI to follow as the Player’s HumanoidRootPart but for some reason the NPC always stops before the NPC event touches the player:

image

function RunToVictim()
	local NPC = script.Parent
	local humanoid = NPC.Humanoid
	
	local destination = nil

	for i,v in pairs(script.Parent.Victims:GetChildren()) do
		destination = v.Value
	end
	
	local path = PathfindingService:CreatePath()

	print(destination)

	path:ComputeAsync(NPC.HumanoidRootPart.Position,game.workspace[destination.Name].HumanoidRootPart.Position)
	
	local waypoints = path:GetWaypoints()
	
	
	for _, waypoint in pairs(waypoints) do
		local part = Instance.new("Part")
		part.Shape = "Ball"
		part.Material = "Neon"
		part.Size = Vector3.new(0.6, 0.6, 0.6)
		part.Position = waypoint.Position
		part.Anchored = true
		part.CanCollide = false
		part.Transparency = 0
		part.Parent = game.Workspace
	 
		humanoid:MoveTo(waypoint.Position)
		humanoid.MoveToFinished:Wait()
	end
end

Edit: If I put this on a loop the NPC will move a stud and then stop again but gets to the player but not how intended.

This is happening because you’re using MoveToFinished:Wait(). The script is waiting for the MoveTo to end, and then it waits. I’m not entirely sure if that’s the reason why, but I’m quite positive it is.

Try doing a wait(.75) instead of MoveToFinished:Wait()

It does help with the issue, but it now either just can’t catch up to the player or stutters back and forward when near the player.
https://gyazo.com/bb92c9618c040547554d2d616123ae5b

If you’re only running this function once, then it would stop at the position it was told to move to, it doesn’t automatically update the player’s position.

I would check to see if the player is a certain distance away from the last waypoint, then recalculate the path, OR use a raycast to see if the player is in it’s line of sight, then just use MoveTo to move to the player then if not, calculate a path using the pathfindingservice.

It runs in a while loop as said

For the stuttering, try SetNetworkOwner(nil) on the rootpart for the NPC.