Best practices for optimizing humanoid:MoveTo()

I am trying to make a tower defense entity system, and i am using humanoid:MoveTo()
I have removed any excessive properties to the npcs ,and optimized it as best as i can, but when im spawning 100,000 at a time, it still slows down and crashes. Any help?

well instead of spawning 100k npcs, you could spawn them maybe 1k or 10k at a time (this would make waves longer but it’s better than dealing with 100k at once)


100k is absolutely insane. The best you can do is make all the npc client sided and use simple path module.

100,000 Humanoids is going to lag the game no matter what. Have you considered just using Parts on the server instead and drawing all visual features on the client?

Your tower defense game should not have more than 300 NPCs spawned at once. Try spawning less, but give them more health! It will feel much less crowded and easier, while remaining just as hard.

1 Like

Well… It works shockingly well for 100,000. It brings me down to like 30 fps, and is insanely glitchy, but it works. i think il stick to the thousands tho. But the npcs still lag behind, like this…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.