I am working on a PvP game, but if players choose so, they can battle NPCs. My only problem is I am unsure to what the best way to make all my NPCs move toward the players is, currently I have a loop that checks to see if there are the right amount of NPCs and then loops through the current NPCs to finds the closest player to it and calls a function to use PathFinding to move the NPC to the player.
My current method does not work, instead it does this:
robloxapp-20220228-1754381.wmv (637.8 KB)
How can I fix and improve my system?