# SetPreBakeCollisionMesh(bool, bool)

> Enables or disables pre-baking of collision mesh data during player build for all imported meshes.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public void SetPreBakeCollisionMesh(bool isConvex, bool preBake)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): True to configure convex collision mesh data, false to configure triangle collision mesh data.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): True to enable pre-baking of the specified collision type, false to disable it.

### Remarks

This method allows you to control whether convex or triangle collision mesh data should be pre-baked during player build for all the imported meshes of that model. Pre-baked collision mesh data improves runtime performance when the mesh is used with a [MeshCollider](/engine/6000.6/script-reference/unityengine/meshcollider.md) component.

When collision mesh data is not pre-baked, Unity generates the collision representation at runtime, which may impact performance.

Additional Resources: [ModelImporter.HasPreBakeCollisionMesh](/engine/6000.6/script-reference/unityeditor/modelimporter/hasprebakecollisionmesh.md), [MeshCollider](/engine/6000.6/script-reference/unityengine/meshcollider.md).
