- Home /
How to create a Mini Map at runtime
hi, guys. I wanna to create a mini-map at runtime, and i have some points that represent the road, and when the character moves, it is reflected to the mini map, how can i realize it? using the GL class or Gizmal? Is there some good idea?
Any reply will be apprecaite
Answer by Scribe · Mar 26, 2011 at 02:41 PM
hi, you might want to check out this answer:
http://answers.unity3d.com/questions/18307/mini-map-radar-screen-with-different-blips
which is related to this demo:
http://www.dastardlybanana.com/radarDemoWebPlayer.htm
and this is where to download it:
http://www.dastardlybanana.com/radarPage.htm
it is very easy to edit.
If your more looking for a camera image from above the player there is this answer:
http://answers.unity3d.com/questions/6913/how-do-i-attach-a-camera-to-a-gui-for-a-mini-map
next time please search the site for answers before asking the exact same thing. I spent about 30 seconds searching
Thank you very much. in fact, i have searched it on this website, i just searched the tag "$$anonymous$$i-map" and got no satisfying result. However, i know how to realize the radar, but it's not exactly what i want,the question that i am concerned about is that how can i draw the road in a specific area dynamicly.
sorry I didn't understand your question and I still don't fully, are you trying to create a radar type thing with a map OR are you building a road at runtime in a specified area. Sorry been ill the last couple of days probably me just being a bit slow
$$anonymous$$aybe it's my fault! my question seems not to be clear.And here, i will state my view again with a example: There is a character in my Terrain, and the terrain is very large, also, the terrain is generated at runtime. And i have some points measured by the $$anonymous$$easuring Department that respect the road, what is important is that, the road points are not fixed.So, i must draw it at runtime,so is in the radar.
In brief, i wanna to draw a radar which can draw the road dynamicly.For example, when the character moves into limited range, draw the road on the radar, if the character moves out, the road disapper too.
So the road is hidden by the "fog of war" on the $$anonymous$$imap, right?
Answer by jorjdboss · Jul 27, 2012 at 09:04 AM
I did it this way and it works out pretty well. From Daniel's answer above, follow the last link to attaching a second camera for a gui minimap. This method works fine except that both cameras render the same thing wasting performance. So to avoid rendering twice, you could do this:
Create a separate layer called something like 'minimap'
Set the second camera's culling mask(in inspector) to render only this layer. Similarly uncheck rendering of minimap layer in main camera's culling mask.
Ask your artist to give you a picture of the top view of the environment. This need's to be approximately 1/4th the size of the target resolution.
In Unity place a plane in the middle of your environment and scale it evenly till it fits the entire location.
Apply the picture from the artist onto this plane and change the material if needed.
Scale it and move it till it matches the actual environment. Change the plane's layer to 'minimap'
So the main camera renders everything except minimap layer, and second camera renders only minimap layer.
For showing elements on the minimap:
Attach planes to each character/object you want to show on the minimap, facing upwards.
Change the texture to an arrow/circle(or whatever you want it to look like on the minimap)
For each plane change the layer to 'minimap' and Voila! a proper minimap
Your answer
![](https://koobas.hobune.stream/wayback/20220613115002im_/https://answers.unity.com/themes/thub/images/avi.jpg)