Game OPTIMIZATION methods

Hi! I know that there’re a lot of questions about this on this page, but I can’t find answer for MY game.

In my game there’s a looot of small cubes which are using physics (rigidbodys with gravity switched on etc). It’s because I shoot projectiles to cubes. Some of targets are windows, which are trashing and makes a lot of small cubes. I do only 1/3 of my level and already the game is lagging (Normally there’s about 70 FPS, but when I shoot too much cubes and windows it decreases to about 1-6 FPS).

**I tried to:

  • Disable scripts, when they do their job (there’re a script for 90% of cubes, so I thought it can be very useful);**

I know that games like this are hard to optimize, but I hope you can tell me some hints and reply me.

Sorry for my bad English. I hope you know what I mean. When you reply me, please use simple words and sentences.

[EDIT]: I haven’t got Pro Version of Unity and I can’t use Profiler window to tell you some more important informations.

[EDIT]: I see (in stats window) that value “Verts” varies between 6-40K. How can I reduce it and no delete my cubes (I see it’s because my windows)?

[EDIT]: I forgot to tell you there’s no difficult models in my game now.

As some of the comments have stated, it sounds like you have too many game objects with rigidbodies attached. Both of these will affect performance. Each game object has scripts and components that need to be processed each frame. Each rigidbody is run through physics simulation as well. You need to consider cutting down the number of game objects that are active at any given time.

Try to keep the number of rigidbodies low. It depends on the hardware that the game is being run on (mobile, pc, web, etc…) so an exact number can’t be given.