Best way to make an NPC follow waypoints

I am trying to make an NPC I have follow waypoints I have set with pathfindingservice. However, I noticed that there is a decent wait period in the code below between the MoveToFinished event and the next MoveTo call leading to the NPC stopping temporarily at each waypoint. What other methods can I use to make my NPC follow the waypoints without any wait after reaching the first point.


        for _,v in ipairs(waypoints) do
            
            if v.Action == Enum.PathWaypointAction.Jump then
                InjuredNPC.Humanoid.Jump = true
            end

            InjuredNPC.Humanoid:MoveTo(v.Position)
            InjuredNPC.Humanoid.MoveToFinished:Wait()
        end

I don’t really see anything to fix this issue, I mean I can tell other bots with this system doesn’t have any stuttering when reaching a waypoint. Could be the model’s ownership issue, try setting the ownership to the server(nil).

That worked though I cant imagine why. I checked the network owner before and it printed out nil everytime.

I’m pretty sure most parts are set to automatic network ownership, so getnetworkowner would still return nil, even though it would change to player once the part got close enough. by forcefully setting the network owner to the server, it should turn off the automatic ownership, and thus why I think this solution works.

That’s because it’s set to the server. By manually setting the ownership, it will only make sure the physics calculation are handled by the server or the client.

Prevents automatic network ownership switching, (specifies a single entity to retain network ownership of an instance).

Yeah that’s what I do when my NPC is stuttering.