# Performance Optimizer (Pro)

The excessive use of separate meshes in Unity can significantly affect performance. To mitigate this impact, it is possible to combine these meshes into a single mesh as long as they are part of a common kinematic group and are not moving independently.

{% hint style="info" %}
Combining meshes is a powerful feature that can significantly improve performance in large models. This can result in up to 4 times faster performance. However, it is not recommended for smaller models.
{% endhint %}

The Performance Optimizer can be applied to any Gameobject, typically at the top level of the imported CAD data. All its child meshes are taken into account during the optimization process.

The optimizer considers whether a Gameobject is part of a [Group ](https://doc.realvirtual.io/components-and-scripts/motion/group)and if that group is assigned to a [Kinematic](https://doc.realvirtual.io/components-and-scripts/motion/kinematic). For each "Kinematic Group," a single optimized mesh is generated and named after the group. The optimized mesh is automatically set as non-Static.

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-3324dd9342b91651348aeec7fdb3be77e5daa29c%2Fperformanceoptimizer.png?alt=media" alt=""><figcaption></figcaption></figure>

If a Gameobject is part of a group that is not used in a [Kinematic ](https://doc.realvirtual.io/components-and-scripts/motion/kinematic)and the "Combine Non-Kinematic Groups" option is turned on, a separate optimized mesh is generated. This mesh is set as Static.

Optimization is initiated by clicking the `Optimize` button. The combined meshes resulting from the optimization process can be found as children of the `OptimizedMeshes` Gameobject.

Please note that after optimization, the original meshes are deactivated but the corresponding Gameobjects remain in the hierarchy. All previously defined colliders will remain active. The optimization process can be undone by clicking the `Undo Optimize` button.

## Properties

#### IsOptimized (readonly)

This property indicates whether the meshes have been optimized or not.

#### NumOptimziedMeshes (readonly)

This property provides the number of meshes that have been optimized as a result of the optimization process.

#### NumUnOptimziedMeshes (readonly)

This property provides the number of meshes that have not been optimized.

#### Ignore Groups

This property allows you to specify the groups that should be ignored during the optimization process. By default, all groups are considered during the optimization process.

#### Ignore Hidden Object

This property allows you to ignore hidden objects during the optimization process. By default, hidden objects are considered during the optimization process. If Hidden Objects are ignored, they are not part of the resulting combined mesh.

#### Combine Non Kinematic Groups

This property allows you to combine the meshes of groups that are not assigned to a Kinematic. By default, only the meshes of groups assigned to a Kinematic are combined.

#### Ignored Groups

In this list you can define groups which should be totally ignored and not be part of the combined mesh. These Groups remain fully active inside the structure.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.realvirtual.io/components-and-scripts/performance-tools/performance-optimizer-pro.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
