---
name: "diag_setTerrainHeight"
type: command
status: deprecated
replaced_by: ["setTerrainHeight"]
groups: ["Diagnostic"]
arma3_since: "2.06"
branch: "diag"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/diag_setTerrainHeight
revid: 377518
updated: 2026-01-02T06:52:04Z
---

# diag_setTerrainHeight

*Command · Diagnostic · Arma 3 v2.06 · branch: diag*

> [!WARNING]
> This command is deprecated. Use [setTerrainHeight](../commands/setTerrainHeight.md) instead.

## Description

Changes the terrain height of the cell in which given position lies. This command is only available with Arma 3: Diagnostics Exe.

> [!WARNING]
> This causes an instant CTD when *position* is out of the map! (`< 0` and/or `> worldSize`)

> [!CAUTION]
> This information is **obsolete**. This command is subject to be removed and replaced with: [setTerrainHeight](../commands/setTerrainHeight.md)

## Syntax

```sqf
position diag_setTerrainHeight height
```

**Parameters:**

- `position`: [Position](../topics/Position.md)
- `height`: [Number](../topics/Number.md)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
private _fnc_flattenTerrain =
{
    params ["_start", "_a", "_b", "_h"];

    for "_xStep" from 0 to _a do
    {
        for "_yStep" from 0 to _b do
        {
            _start vectorAdd [_xStep, _yStep, 0] diag_setTerrainHeight _h;
        };
    };
};

private _desiredTerrainHeight = 150;
[getPosWorld player, 50, 50, _desiredTerrainHeight] spawn _fnc_flattenTerrain;
```

## See also

[diag_getTerrainHeight](../commands/diag_getTerrainHeight.md)

<sub>Source: [BI Community Wiki — diag setTerrainHeight](https://community.bistudio.com/wiki/diag_setTerrainHeight) (revision 377518).</sub>
