In order to test my computer and Unity3d profiler, I set a scene with a plane and 1800 cubes. Each cube has rigidbody and collider attached.
[13566-screen+shot+2013-07-27+at+2.36.14+am.png|13566]
There is one thing I do not understand. As my “game” progresses, cubes fall out of stage, and their geometry is destroyed. In the Rendering row, you can see that number of draw calls, triangles and vertices decreases over time as expected. Something I am surprised of is that number of active rigidbodies stays the same all the time.
[13567-screen+shot+2013-07-27+at+2.37.01+am.png|13567]
Isn’t rigidbody supposed to be destroyed as it falls off the stage?
Thank you for your answer! That explains a lot, but am supposed to destroy rigidbodies myself, if I have it somewhere offscreen? Or is there some "AutoDestroy" checkbox for rigidbodies in Unity somewhere?
– a.smolovAs far as I know, there is no built-in way to do it. If you want rigidbodys to be destroyed when off screen, you will have to script it
– dorpelegGot it! Thanks again!
– a.smolovIf you're really worried about performance, you should not be using Instantiate and Destroy, rather you should make the objects active/inactive and store them in a pool. Check the AngryBots demo, and how the bullets and missiles are managed. http://www.google.com/search?btnG=1&pws=0&q=unity+pool+objects+
– AlucardJayThank you, @alucardj! I will take a look.
– a.smolov