games with randomly shaped maps

In some games there is a map composed of regions that has a complete random shape. (think about strategic games, like RISK or Making History if you have played this game)

When player right click the region where the unit should be moved to, any pixel in that region will make the unit move to the center of that region, although not necessarily the pixel clicked. So I am wondering, how do you detect click in a irregular shaped region in a map?

Thanks in advance!

1 Answer

1

This has come up before, with two solutions. Either make each region of your map a single mesh collider (very complicated unless you are good at modelling), or use a colour map with GetPixel.