How to speed up rendering/batching for multiple instantiated prefabs

Hi all,

Iva a project where im spawning lots of prefab models to generate the environment. (say 100 or so).
If i leave these prefabs individual (sort of have ot since they hold scripts) the framerate of my app really drops.
Theres only about 2 materials shared between them atm, so uinty is batching them into 2 bunches. (after id workout out that you cant dynamic batch with lighting on… nice documentation )

I was hoping that batching would speed up the rendering speed and get me a higher fps, but the difference is marginal.
Are there any tricks to handling large arrays of relatively low poly prefabs in a scene. Culling isnt going ot help much here either, since my camera view is pretty high and hte fov will take in most if not all the objects.

Ive run a test where i just sombine the meshes, and i gain about 100fps, but i cant use this as each prefab has a script that is called occasionally (not on update though).

Has anyone got any tips?

Thanks

Tom

Have you tried the CombineChildren script that comes with Unity? It is used to merge the children of a gameobject into one mesh (or two in your case for two materials), which will reduce draw calls.

Ok I found out the problem, thought id post here in case its ever useful to someone else.
Basically NEVER EVER put ONGUI calls in anythign that is likely to be instantiated lots of times.
Even though the output of ongui isnt visible in the game window it absolutely decimates the framerate (didnt check outside the editor)
Just avoid…!