Version: Unity 6.6 Beta (6000.6)
Language : English
Set up GameObjects for static batching
Combine meshes manually

Enable static batching

Combine static meshes at build time or at runtime. For more information about batching, refer to Introduction to static batching.

You can enable static batchingA technique Unity uses to draw GameObjects on the screen that combines static (non-moving) GameObjects into big Meshes, and renders them in a faster way. More info
See in Glossary
in two ways:

Batch static meshes at build time

To batch static GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
at build time, enable static batching. For more information about batching, refer to Introduction to batching meshes.

Follow these steps:

  1. Go to Edit > Project Settings > Player.
  2. In Other Settings, enable Static Batching.
  3. In the SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
    See in Glossary
    view or Hierarchy window, select the GameObject that you want to batch. You can select multiple GameObjects at the same time to enable static batching for all of them.
  4. In the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
    See in Glossary
    window, select the Static Editor Flags dropdown and enable Batching Static.

If you use static batching at build time, Unity doesn’t use any CPU resources at runtime to generate the meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary
data for the static batch.

Note: Unity uses additional memory to store the combined meshes, even if the meshes are the same. For example, marking trees as static in a dense forest environment can have a large impact on memory. If static batching uses too much memory, combine meshes manually instead.

If a mesh is culled because it’s outside the cameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
view, Unity might not be able to draw all the meshes in a single draw call. This is because the culled mesh leaves a gap in the combined vertex buffers.

Batch static GameObjects at runtime

To batch static GameObjects at runtime, for example GameObjects you create procedurally, follow these steps:

  1. Select each mesh you want to batch, then in the Inspector window enable Read/Write enabled.

  2. Use the StaticBatchingUtility API to batch the meshes. The StaticBatchingUtility.Combine method combines GameObjects and prepares them for static batching.

Note: To avoid the read/write mesh using double the amount of memory, you can now delete one copy of the mesh by calling the Mesh.UploadMeshData API with markNoLongerReadable set to true.

You don’t need to enable the static batching setting in the URP asset, HDRP asset, or Player SettingsSettings that let you set various player-specific options for the final game built by Unity. More info
See in Glossary
.

If a mesh is culled because it’s outside the camera view, Unity might split the batch into two batches, to avoid a gap in the combined vertex buffers.

You can only change the position, rotation, and scale of the whole batch at runtime, not the individual meshes.

Additional resources

Set up GameObjects for static batching
Combine meshes manually