How to get a TerrainData heightmap position given a RaycastHit

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.

6134468--669032--HeightMapRaycatstHit2.jpg

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.

I have a little first person run-around-and-fling-grenades to deform the ground demo in my MakeGeo repository.

Inside that code is all the stuff you would need to find that entry in the terrain heightmap.

Look for the TerrainDamager scene in MakeGeo. MakeGeo is presently hosted at these locations:

https://bitbucket.org/kurtdekker/makegeo

Hi, thanks for the replies!!
I think I got a good base with this .
I’ll polish it a little bit more before post the code.