# HasPreBakeCollisionMesh(Mesh, bool)

> Checks whether the mesh should pre-bake collision data during a player build.

## Definition

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

```csharp
public static bool HasPreBakeCollisionMesh(this Mesh mesh, bool isConvex)
```

### Parameters

**** (\[Mesh]\(/engine/6000.6/script-reference/unityengine/mesh)): The mesh to check.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): True to check for convex collision data, false to check for triangle collision data.

### Returns

| Type                                                          | Description                                                                                          |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the mesh should contain pre-baked collision data in a player build, false otherwise. |

### Remarks

When building a player, convex and/or triangle collision data can be pre-baked inside the Mesh. This allows [MeshCollider](/engine/6000.6/script-reference/unityengine/meshcollider.md) referencing that Mesh to efficiently fetch that collision data at runtime.

When no collision data is pre-baked, it will be generated at runtime when the mesh is used with a [MeshCollider](/engine/6000.6/script-reference/unityengine/meshcollider.md), which can have an impact on performance.

Note that the collision data is only baked during a player build, so if the methods returns true but the mesh hasn't been built yet as part of player build, it means it doesn't contain any pre-baked collision data yet.

Additional Resources: [PhysicsEditorMeshExtensions.SetPreBakeCollisionMesh](/engine/6000.6/script-reference/unityeditor/physicseditormeshextensions/setprebakecollisionmesh.md), [ModelImporter.SetPreBakeCollisionMesh](/engine/6000.6/script-reference/unityeditor/modelimporter/setprebakecollisionmesh.md), [MeshCollider](/engine/6000.6/script-reference/unityengine/meshcollider.md).
