Okay, I might have came up with a good idea, but I’m not sure.
So, I have noticed that the new path is computed after the humanoid finishes the segment of the previous path. It takes a bit of time, so the humanoid is forced to stop for a small amount of time.
But, what if the new path is computed while the humanoid is walking to one of the waypoints? I think this way you’d be able to get around the small delay that occurs when creating a new path.
in my game i just changes the WaypointSpacing on Agent Parameters to 10 and change the MoveToFinished:Wait() into repeat wait() until dist <= 10
you might also want to change a few components in the Agent Parameters to make it not stuck on trees.
this one is a bonus but you can add a raycast from the NPC to the player, if the raycast hit then don’t use pathfind and just walk straight to the player else use pathfind. that way it wouldn’t lag too much.
using this the NPC in my game doesnt stutter and pathfind correctly.
My issue with this solution is just the fact that, if the player is above to NPC and the NPC’s raycast can still see the player, the NPC won’t even attempt to get up to the player. I want the NPC to be smart and attack from anywhere.