optimizing huge amount of objects

Hey, I’m still here, that’s my question: why FPS falls down to 2, if I have about 3000 game objects? They are far away from a camera, they are culled (per-layer) and invisible, so it’s just 50-60 draw calls. They are trees and various vegetation, but I don’t want to make an one mesh from them: every of them will have some script and animation. But now they don’t have anything except meshes and materials (same for all), they’re culled, and it’s only 2 fps. What should I do to optimize this? Note: without joining to one mesh!

every of them will have some script and animation

If you have several thousand objects, but are pretty sure that rendering isn’t your bottleneck, then it’s most likely the scripts or other components attached to those objects.

If you have Unity Pro, the profiler is invaluable in diagnosing this sort of problem. If not, you can try removing components one-by-one to see if any of them are a performance hotspot.

My experiments go well. For each tree I added script, which check distance between tree and camera every 2 seconds, and if distance is less than 100, it starts drawing cycle. Drawing cycle - function, which in cycle FOR calls method Graphics.DrawMesh, and then waits (yield WaitForSeconds(0.01). There is no update func. Drawing cycle goes on only if distance is less than 100. But here is some bug: with 0.01 trees flick. I’ll try 0.001 or any other value. FPS is about 90-100. Good result.