I need to use the §flatten terrain" tool to raise a perfect cube from the terrain, so there is a 90 degree angle between the cube and the rest of the terrain. When I use one of the brushes of the editor, there is always a trainsition between the top of the raised part and the floor, so that it looks like a mountain or something like that.
Is there a possibility to raise a part of the terrain, so that there is a 90 degree transition between the raised part and the rest of the terrain?
Check out the page for the Terrain class script reference, and the TerrainData script reference.
I’m not sure whether or not
SetHeights will actually accomplish what you are looking for, but from what I can tell it’s your best bet, apart from simply integrating a shape that shares the same texture as the terrain, itself.
I don’t think that 90 degree angles are possible in terrains. The heights are stored in a two-dimensional matrix of floats (default being 513x513) whereas the terrain is a (mostly) continuous surface. To calculate the height of the terrain at a given point, Unity just interpolates among the surrounding 2-4 heights in the height map matrix. Thus, unless one of your heights is infinity, you’ll never get a 90 degree angle.