What I would like to do is to display a Mini-Map that is smaller than my actual terrain. I would like to display the scaled down terrain as a non-moving GUI at the approximate coordinates: x = 960, y = 340, with width as 280, and length as 210 (pretty much the bottom-right hand corner of the screen).
To acheive this, I could scale the terrain down to roughly meet those values, but when it comes time to display a player indicator (the 2D texture) for as the player is moving, the coordinates do not coorrespond, in other words, it is inaccurate.
What I can do is just draw a GUI Box where I need it to be, scale down the position of the player and also the terrain to conform to where I want the GUI Box.
The code below is inaccurate
Edit -- How could I get game objects that do not move to show up accurately?
I would suggest taking an above-terrain screenshot, and using that as a GUI texture. Then you can script it to rotate as the character rotates and have it zoomed in. If you want, then you can use Paint or something else to add the nonmoving objects. Hope that helps.
answered Aug 19 '10 at 12:40 AM
I would avoid using GUI Textures for your player indicator when you also used a terrain for the map. Then, you don't want to use a scaled version of your terrain, because that will give you poor performance. Grab a screen shot of the terrain and apply it to a plane or cube then have a second camera that renderers only the plane/cube. Then place an indicator object such as a sphere or a plane on top.
You can scale the second camera's normalized viewport rect to have it fit in the shape you want. Then I would use the script I wrote in this tread to have your indicator line up with the player.
One last point is that if you use GUI for your mini-map, then I would make sure you whole mini-map is set up using Unity's GUI system. That way you can do the coordinate math without changing from world space to screen space.
answered Aug 16 '10 at 12:59 PM