A way to combine children into one object?

I’m trying to decrease lag in my game so I can have more enemies on screen. I have a parent object with a bunch of children that are generated randomly. There are 200 of the. Is there a way to make them into one big object to reduce lag?

Also any other tips to optimize it would be awesome

(2D)

You can use Unity’s static batching functionality for this: Unity - Scripting API: StaticBatchingUtility.Combine

Hi,

The number of GameObjects almost certainly is not the issue, especially if you only have 200.

First, run the Profiler to identify the cause of the lag. Don’t shoot an arrow until you know where the target is.

If it’s graphics-related, check the Optimizing Graphics Performance page for specific solutions.