# GenerateMeshLods

> Creates automatic Mesh LOD for a given mesh.

## Definition

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

## GenerateMeshLods(Mesh, int)

Creates automatic Mesh LOD for a given mesh.

```csharp
public static void GenerateMeshLods(Mesh mesh, int meshLodLimit = -1)
```

### Parameters

**** (\[Mesh]\(/engine/6000.6/script-reference/unityengine/mesh)): Mesh to generate LODs for.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The maximum number of LOD levels to generate. If the value is 0, the method does not generate any extra LOD levels in addition to the original mesh. If the value is negative, the generation process stops when the next Mesh LOD level has around 64 indices.

## GenerateMeshLods(Mesh, LodGenerationFlags, int)

Creates automatic Mesh LOD for a given mesh.

```csharp
public static void GenerateMeshLods(Mesh mesh, MeshLodUtility.LodGenerationFlags flags, int meshLodLimit = -1)
```

### Parameters

**** (\[Mesh]\(/engine/6000.6/script-reference/unityengine/mesh)): Mesh to generate LODs for.**** (\[LodGenerationFlags]\(/engine/6000.6/script-reference/unityeditor/meshlodutility/lodgenerationflags)): Mesh Generation settings.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The maximum number of LOD levels to generate. If the value is 0, the method does not generate any extra LOD levels in addition to the original mesh. If the value is negative, the generation process stops when the next Mesh LOD level has around 64 indices.
