Many objects - optimization

Hello! I have a big problem. So - I’ve thousands of generated gameObjects. They have one script, meshRenderer and other stuff like that. When all objects are invisible (I disable specific camera layer) - my FPS is still very low. I think it’s not a good idea - creating many objects in one scene. So - what I can do now? What is professional way to optimize it?

Thanks in advance :wink:

PS: Sorry for my english :wink:

It depends a lot on what kind of objects. Generally, if they are static, then you want to batch all of their renderers together into a single, or at most a few meshes/objects. Maybe one per layer, then you only have to (de)activate one object per layer as well.

I also highly recommend using the Profiler in Unity. You may be able to track down a slow bit of code and fix it without having to change the general setup.