I am trying to find a way to optimize a lot of humanoids so I can make some NPCs. The problem is, however, even without any scripts, they are causing a lot of lag. I placed 1600 NPCs on my workspace, they do not contain any scripts and are just empty NPCs with no function. However, when testing, my FPS dropped all the way to 30. If this is a problem, then how do I make them function with scripts? How can I solve this problem?
Use SetStateEnabled to disable every state that you do not need. The Climbing state, for example, casts out rays in front of the RootPart to detect a truss/part ladder. Disabling the Climbing state prevents it from casting those rays, giving you a noticeable performance boost when dealing with large numbers of humanoids.
2 Likes