- Home /
Highlighting parts of an object
I can see from other questions how to highlight a whole object, but how can I work with only part of an object?
Let's say I have a simple sphere representing my planet, and a texture for my continents and oceans. I want to add black borders for political regions and let the user click them. When the user clicks on a country it should change colour.
I was thinking I could make a sphere slightly larger than the original one and map a largely transparent texture with the political boundaries onto that, but I am still not clear how to interact with the specific regions. Visually that would work, but seemingly impossible to script.
Am I supposed to draw all the regions as separate objects and have them hover slightly above the planet surface? If so, how would I take a 2D region map and convert it into a series of textures wrapped around a spherical center?
Any pointers would be appreciated.
Bassically all the regions will have to be seperate objects, as for converting them to diferent objects you could try using a image editing software such as GI$$anonymous$$P2.6(free) or Photoshop. then just make the whole region able to be highlighted.
hope this helped!
Thanks for your comment technor. I was also thinking that if I could extract the local coordinates of where on an object the click occurred, I could put a region shaped decal onto the appropriate spot. That way I don't have to introduce a ton of extra polygons into the mix. I yet figured out if I can get those local coordinates though.
Answer by xylax · May 01, 2012 at 05:34 AM
Create a collider mesh for each country and use Graphics.DrawMeshNow to draw a mesh with a "highlight" material when the country is selected.
Your answer
Follow this Question
Related Questions
Can i add texture to multiple layers of player? and how? 0 Answers
Textures are not tiling properly on my wall model! 3 Answers
Cycle Textures Over Time 2 Answers
Paint textures on an object 0 Answers
object can't be null when highlighted in the inspector? 1 Answer