- Home /
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!
Answer by AlucardJay · Apr 23, 2013 at 05:54 PM
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.
GetPixel Method : http://answers.unity3d.com/questions/289506/view.html
Individual Collision Meshes Method : http://answers.unity3d.com/questions/196095/risk-like-regions.html
Your answer