# CreateFromPlacement

> Creates a TerrainMap from the positions of all active Terrains.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.TerrainUtils](/engine/6000.5/script-reference/unityengine/terrainutils.md)
* **Assembly:** UnityEngine.TerrainModule

## CreateFromPlacement(Terrain, Predicate\<Terrain>, bool)

Creates a [TerrainMap](/engine/6000.5/script-reference/unityengine/terrainutils/terrainmap.md) from the positions of all active Terrains.

```csharp
public static TerrainMap CreateFromPlacement(Terrain originTerrain, Predicate<Terrain> filter = null, bool fullValidation = true)
```

### Parameters

**** (\[Terrain]\(/engine/6000.5/script-reference/unityengine/terrain)): Defines the grid origin and size, as well as group id if no filter is specified.**** (\[Predicate\<Terrain>]\(https\://learn.microsoft.com/dotnet/api/system.predicate)): Filter to be applied when populating the map. If null, the filter will fall back to matching terrains in the same group as the origin.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Validate the Terrain map. Default is true.

### Returns

| Type                                                                                 | Description                                                                         |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| [TerrainMap](/engine/6000.5/script-reference/unityengine/terrainutils/terrainmap.md) | The resulting Terrain map. Can return null when no Terrain objects pass the filter. |

### Remarks

Creates a [TerrainMap](/engine/6000.5/script-reference/unityengine/terrainutils/terrainmap.md) of all the loaded Terrain objects that pass the filter validation.

## CreateFromPlacement(Vector2, Vector2, Predicate\<Terrain>, bool)

Creates a [TerrainMap](/engine/6000.5/script-reference/unityengine/terrainutils/terrainmap.md) from the positions of all active Terrains.

```csharp
public static TerrainMap CreateFromPlacement(Vector2 gridOrigin, Vector2 gridSize, Predicate<Terrain> filter = null, bool fullValidation = true)
```

### Parameters

**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): Origin of the grid.**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): Size of the grid. Typically takes the terrain size.x and size.z.**** (\[Predicate\<Terrain>]\(https\://learn.microsoft.com/dotnet/api/system.predicate)): Filter to be applied when populating the map. If null, the filter will fall back to matching terrains in the same group as the origin.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Validate the Terrain map. Default is true.

### Returns

| Type                                                                                 | Description                                                                         |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| [TerrainMap](/engine/6000.5/script-reference/unityengine/terrainutils/terrainmap.md) | The resulting Terrain map. Can return null when no Terrain objects pass the filter. |

### Remarks

Creates a [TerrainMap](/engine/6000.5/script-reference/unityengine/terrainutils/terrainmap.md) of all the loaded Terrain objects that pass the filter validation.
