I’m trying to get a specific rectangle from the TerrainData heightmap using 4 RaycastHits. Mine intention is to rise/lower the terrain only in the area of this rectangle.
The RaycastHit returns me a lot of information (as in the image) but I don’t know witch one to use nor how…
Need some help, please.
You’ll wanna do GetComponent() (I think) and then access its .terrainData (Unity - Scripting API: Terrain.terrainData). You should then be able to access (and edit I think) its heightmap etc: Unity - Scripting API: TerrainData. I guess to get the correct heightmap points you would have to convert your world coordinates to the heightmap coordinates using some epic math equations.