Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Best way to implement NPC movement?

Asked by 6 years ago

Hello. I'd first like to point out that finding a place to ask questions since the Roblox forums shutdown was a nightmare. (Possibly one of the worst decisions since tix was removed)

Anyway, I have been working with NPCs in various ways and would like to know what the most efficient way to move a series of humanoids at the same time would be. I have currently tried these methods:

  1. Running a looping script from the client to check if there are any NPCs within a certain range and then using coroutines to move the NPCs if they are still in range.

  2. Running a script that finds all the NPCs within the server and finding the nearest ones and then calling a remote event to move the NPCs to the players location.

Is there a more efficient way and if so which,I simply require the humanoid to moveto the preferably using the moveto() function. I've also tried using pathfinding but this is an expensive request and when implemented on many NPCs, caused lag.

Thanks in advance to anyone who may have a solution to this query.

0
It could be possible to move all of the close ones to a common point then pathfinding from that single point, but im not too sure. NexanianStudios 91 — 6y

Answer this question