x


Hot to do a selectable world map?

I'm starting with a board game in Unity like Risk, programming in C#, and I need a selectable world map to put the armies on each region and make it the game board. I have a Raycasting function to select each country but I need to know how to build the board and make the countries selectable.

I have a board like this: http://2.bp.blogspot.com/-vtEHvcmS-Ac/TtHk0IvsxoI/AAAAAAAAAnw/V6e_eGfmCac/s1600/Risk+II+Game+Board.jpg

And I want to be able to select the countries separately, like they're objects on their own. Do you know any ways to do that?

Thanks for the help!

more ▼

asked Jul 24 '12 at 12:57 PM

Kehos gravatar image

Kehos
84 2 3 7

I'm confused, I have a Raycasting function to select each country , I want to be able to select the countries separately , this is a contradiction.

I was thinking you could get the colour of the pixel from the raycast to determine the country, but for the regions in the country that would be trickier (unless you had very subtle colour changes in the regions, that a get pixel would detect but the human eye wouldn't)

http://www.google.com/search?btnG=1&pws=0&q=unity+raycast+read+pixel

Jul 24 '12 at 03:13 PM alucardj

I just noticed this is a Duplicate Question

Jul 24 '12 at 03:17 PM alucardj

My bad sorry, I didn't see I posted this twice!

Jul 24 '12 at 03:19 PM Kehos

np, was probably stuck in the moderation que as new user, so first qn didn't show up. One of the pro's will close this

Jul 24 '12 at 03:24 PM alucardj
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You could try setting a mesh collider on each individual country's shape/model (depending on how you have things set up. If you have terrain, as in the map itself is 3D, then it might be a bit more taxing, but you may want to consider it). Considering how crazy complex international border shapes can be... I'd say, other than some more advanced methods, that would be your best bet.

more ▼

answered Jul 24 '12 at 03:28 PM

DESTRUKTORR gravatar image

DESTRUKTORR
831 3 5 10

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4155

asked: Jul 24 '12 at 12:57 PM

Seen: 735 times

Last Updated: Jul 24 '12 at 03:28 PM