1000's of Objects - Attaching Script to GO vs Foreach Loop

I’m generating thousands of billboard objects during Start(). The quads LookAt (which render as 1 draw call) the camera using a foreach loop that sets the LookAt for each Rigidbody I have created. The objectList is an array that I initialize within Start().

Would it be faster to attach a script directly to each of the 1000s of billboards vs running the foreach loop at each Update()?

Perhaps this is just something that I’ve missed in the docs, or just a lack of understanding on my part. I’m starting to think that it may be faster to attach the script to the object because there would be less overhead?

Thanks!

There’s more overhead if you attach a script to each object. In any case, trying to run thousands of rigidbodies on the iPhone is asking a bit much.

–Eric

On a tangential note: don’t use foreach loops; they allocate on the heap, which is bad. Stick to good ol’ for.