NPC Movement Stuttering

So, I made a similar post around 3 months ago on this topic.

Anyways, I’m back again, and this time it’s not a replication issue (therefore it doesn’t have anything to do with network ownership, regardless of what I’ve made sure the server does have ownership of all parts), as it happens in both the server view and the client view.

It seems to be happening for some NPCs, but for others, it starts happening after a while.
Here’s what it looks like when they start stuttering:

All sorts of help will be appreciated, thanks :smiley:

Update: I tried visualizing the paths my NPCs were going, and it seems like PathfindingService was messing up the waypoints, and they were for whatever reason too close to each other.

RobloxStudioBeta_CjrHrFFkys
As seen in this image, it’s basically just tens if not hundreds of waypoints without a proper gap (for the NPCs that begin to stutter).

Here are my agent parameters, in case that would help at all:

local AGENT_PARAMETERS = {
	AgentRadius = 7,
	AgentHeight = 4,
	AgentCanJump = false,

	WaypointSpacing = 1,

	Costs = {
		Decoration = math.huge,
		Amenities = math.huge,
	},
}

Solution: Seems like I managed to fix this (temporarily?), by setting the WaypointSpacing to math.huge. Doing so also made the whole script a ton more efficient, since it only generates waypoints where there are intersection points.

Good luck to anyone that comes across this post in the future :slight_smile: