I have a simple Boid Flocking simulation (that you can try to join on my profile) that is a single server script which spawns and handles hundreds of parts and their positions (positions get updated on the heartbeat event).
When I test the game in studio, it can run indefinitely (even if I crank up the number of parts spawned and managed massively). However, when I test the game in the Roblox Player, my game always freezes forcing me to end task Roblox Player.
This issue is very strange to me as there is not a single LocalScript in the entire simulation, the only thing that can be causing the lag that I can think of would be the amount of MeshParts I spawn - which even then, should not be an issue because they are just 12 triangles per mesh
Here is the file if you need to check out the setup (although, nothing in my setup even runs client sided):
boids.rbxl (59.7 KB)
If I turn down the number of Boids that spawn to around 100, I can wait for a while in-game before the lag dies down. I think this could mean the lag is coming from the Meshes loading in initially, but I’m not completely sure if that’s the issue, or how I would solve it