# BakeMesh

> Creates a snapshot of TrailRenderer and stores it in mesh.

## Definition

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

## BakeMesh(Mesh, bool)

Creates a snapshot of TrailRenderer and stores it in `mesh`.

```csharp
public void BakeMesh(Mesh mesh, bool useTransform = false)
```

### Parameters

**** (\[Mesh]\(/engine/6000.6/script-reference/unityengine/mesh)): A static mesh that will receive the snapshot of the trail.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Include the rotation and scale of the Transform in the baked mesh.

## BakeMesh(Mesh, Camera, bool)

Creates a snapshot of TrailRenderer and stores it in `mesh`.

```csharp
public void BakeMesh(Mesh mesh, Camera camera, bool useTransform = false)
```

### Parameters

**** (\[Mesh]\(/engine/6000.6/script-reference/unityengine/mesh)): A static mesh that will receive the snapshot of the trail.**** (\[Camera]\(/engine/6000.6/script-reference/unityengine/camera)): The camera used for determining which way camera-space trails will face.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Include the rotation and scale of the Transform in the baked mesh.
