I’m currently working on an game and i need to separate a surface of an object.
I want to achieve that it is possible to click of one part of an specific 3D object. For example i have an object with the shape of an region for example north america, now i want to click on every country but not to click the hole object. So it is possible to choose the country and any ongui elements or pictures will be drawn.
I am stuck at the thing that i can’t form labels or boxes otherwise than a rectangle.
Maybe there is an other option to achieve this ?
I appreciate every help/idea.
I programming in c# actually.
There is a technique I’ve seen posted here a few times using a second texture. Create a second texture the same size as the texture for the mesh for use as a hotspot map. Use color and/or transparency on the texture to mark out the different mappings. To click on the texture, do a Raycast. The RaycastHit.textureCoord to get the pixel clicked on. Using the texture coordinate on the second texture will return a color you can use as an indicator for what area was clicked.
Here is an answer that does something similar:
http://answers.unity3d.com/questions/516609/empty-spaces-in-buttons-are-detected-by-mouse.html