float TerrainHeight { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The TerrainHeight property represents the world size of the maximum height of the terrain in the Sandbox.Terrain class. This property is used to define how tall the terrain can be in the world space, allowing for the creation of varied and realistic landscapes.

Usage

To use the TerrainHeight property, you can get or set its value to adjust the maximum height of the terrain. This property is particularly useful when you need to scale the terrain's height to fit the desired world design or gameplay requirements.

Example

// Example of setting the TerrainHeight property
Terrain terrain = new Terrain();
terrain.TerrainHeight = 100.0f; // Sets the maximum height of the terrain to 100 units

// Example of getting the TerrainHeight property
float maxHeight = terrain.TerrainHeight;
Console.WriteLine($"The maximum height of the terrain is: {maxHeight}");