Modifying Terrain under an Object

I have no idea where to start looking for this one, so I thought maybe someone can point me in the right direction. Basically, I want to be able to read the terrain heights within a given area (what will be a circle that represents possible placement of a building) and either determine that there is too much of a grade at that position to place the object, or determine it is suitable, then flatten the terrain within that circle to one, average height.

Anyone have some suggestions regarding which functions I should be looking at? I’ve never worked with terrain data or manipulating verticies through script before, so please respond to me like I am a 6 year old child. :slight_smile:

Get a link to the terrain (Terrain.activeTerrain). This object of type Terrain has all the data and functionality of the terrain object that’s currently active.

One of the members of this Terrain class ‘terrainData’, contains the data and functionality you need (like the function GetHeights and GetInterpolatedNormal).

All these classes and functions are described in the Script Reference.