How do I stop a stutter step in NPC walking

Hi! I am wondering how I can stop a small stuttering motion after each move to is finished, Is there any way I could like make it move to the next point like 0.05 seconds before coming to a stop so there wouldn’t be that issue with the wait() where the animation stops. Thanks! Script btw :arrow_down_small:

local path = game:GetService("PathfindingService"):CreatePath()
	path:ComputeAsync(NPCToMove.HumanoidRootPart.Position, part.Position)
	local waypoints = path:GetWaypoints()
	local human = NPCToMove.Humanoid
	if path.Status == Enum.PathStatus.Success then
		for _, waypoint in pairs(waypoints) do
			if waypoint.Action == Enum.PathWaypointAction.Jump then
				human.Jump = true
			end
			human:MoveTo(waypoint.Position)
			human.MoveToFinished:Wait()
		end
	end

Another way of phrasing this is how would i predict the time left before a humanoid has reached its goal. I’d just take that calculation and wait that but like a LITTLE less so that the animation is smooth.

1 Like

have you tried Setting NetworkOwner to nil?

I have not no, what would this change in the animation? (also to the npc / humanoid?) which one

NetworkOwner should help with the “Stuttering” of your NPC

So would I set the humanoid to nil or the character itself?

It should be the HumanoidRootPart

human.HumanoidRootPart:SetNetworkOwner(nil)
3 Likes

personally I found that doing

repeat task.wait() until (NPC:GetPivot().Position - Waypoint.Position).Magnitude < 4

instead of

NPC.MoveToFinished:Wait()

helped reduce stutters when changing waypoints

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.