I have a gameobject with a mesh collider. The mesh is simply a flat plane.
I raycast to the mesh and I'd like to get the index on the material's basemap where I got a hit.
I assumed hit.textureCoord
or hit.textureCoord2
would do the trick, but all I get is either (0,0)
or (1,1)
and nothing inbetween.
I triple checked and the collider is definitely a mesh collider, so I can only assume I misunderstood what textureCoord
does
hit.textureCoord2
to paint on has a mesh collider; you might try that with your mesh / Texture2D combo to verify they are in working order. \$\endgroup\$