0
\$\begingroup\$

I am handling the backend on some project while another team works on the GUI of the game.

To my understanding, they plan on dynamically manipulating the heightmap data on some material (in order to create an animation) on an object with a completely flat mesh.

I, on my end, need to raycast (luckily for me, from above in a direction perpendicular to the flat mesh) and get the height.

To that end, I need a way to read the heightmap data from the material.

I've gotten about this far:

raycastHit.collider.gameObject.GetComponent<Material>()

But from here, I couldn't find anything about reading the materials' heightmap. Furthermore, if I could do that, I'm not sure how I would address the point I hit on the heightmap image. I'm assuming it's raycastHit.textureCoord, though the documentation isn't 100% clear to me, and I'm not sure how it differs from _textureCoord and textureCoord2

\$\endgroup\$

0

You must log in to answer this question.

Browse other questions tagged .