Rotating a Ton of Game Objects

I have an object in the middle of my scene that needs to be rotated. The camera is also moved in and out (zoom) as well as up and down (pan).

I have all the rotation and camera movement working just fine.

This object is made up of 10000 individual objects. They are spaced out around the center at random locations, but their locations relative to the parent object never changes.

The individual objects are made at run time using the Instantiate feature on a prefab model and then the parent of each object is made to be the main parent object that I am rotating. This way all of the individual objects do not have to be rotated individually. Rotate the parent = rotate them all.

The problem I have is frame rate. There are a couple of things that are weird to me.

The first weird this is that initially I have my real prefab. This is a pretty cool model with textures and glow features and animation.

If I turn on the stats window I see 3M tris and a frame rate of about 13 FPS. This is actually pretty good considering, but obviously not good enough.

I can rotate, pan and zoom and the frame rate stays about 13 fps. As I zoom in and fewer objects are on the screen the fps does go up as you would expect.

Now here is the weird part. I decided to just make a simple cube model and replace the fancy object with this model. That is the only change. When I start it up the fps is about 40. That is expected. They are just cubes after all and the tris are now at about 50k instead of 3M. What I did not expect is that now when I rotate the frame rate goes to 1 fps. Panning and zooming does change the fps except as you zoom in it goes up to over 90 fps.

Why does rotating cause just a jump? Why does using a cube cause MORE of a jump than using the fancy model?

Last question is that I am looking for suggestions. I can’t image that Unity can’t handle rotating 10000 objects. Can someone help me out here?

To fix the frame rate problem try going to the tender setting and adding fog. I know we all hate it but it sometimes works.

I ended up rotating the camera instead of rotating the 10000 objects. I should have thought of this originally, but was thinking backwards.

The slow down is mostly likely the process of iterating 10000 objects in scripts. I would guess as each object is rotated that also added a drawing operation.

By moving the camera instead there is only a single object to iterate (the camera) and the movement of the objects is handled by the engine which is much faster.