So I had about 30 NPCs in my game that ran around and moved with animations, however, this caused a plethora of lag, client side and server side. So to combat this I created a client side script basically setting a max render distance, if an NPC wasn’t within a 25 stud distance of the player, all of their parts would change to CanCollide = false. This however, didn’t solve the lag problem, so now I shrunk the amount of NPC characters to roughly 20 and only a select few of them can walk, the rest just stand there idly, while also keeping my can collide render script. This seems to have fixed the lag, however I am unsure. I was wondering if you can take a look at this screenshot and let me know if that’s a good Memory usage number to have in the developer console while in-game.
If you have had any similar problems, please let me know how you solved them as well, through code, or game-settings.