Does anyone have an idea on the overhead for empty game objects? Most of the “limits” that people mention in the forums here apply to objects that are rendered, but are there applicable limits for empty game objects, be it absolute, or limited by performance? Asa practical example: Would I run into problems with 1MM empty game objects in parallel?
Anytime I have questions like this one, I just write a quick script and run a test. Here is my script:
#pragma strict
var objectsPerFrame = 100;
var guitext : GUIText;
private var created = 0;
private var time = 0.0;
private var paused = false;
function Update() {
if (Input.GetKeyDown(KeyCode.A))
paused = !paused;
if (paused) return;
time = Time.time;
for (var i = 0; i < objectsPerFrame; i++) {
created++;
var go = new GameObject();
go.transform.parent = transform;
}
guitext.text = time.ToString("N") + " , " + created;
}
I ran the test on a Windows build on a fairly fast machine with 32 GB of memory. The number of game object made no difference in the frame rate. The app crash at 8.4 million game objects. The frame rate just before the crash was 60 fps…the same as when the app was started. Note the behavior of this script in the editor was substantially different than the standalone app.