- Home /
How do I attach a Camera to a GUI (for a Mini map)
Pretty much what the question says. How do I attach a second camera to a GUI box (or whatever shape) in order to create a mini map. The camera would obviously be above the player and follow him showing a top down view of the landscape.
I'm also open to other suggestions to achieve these results for a mini map.
Thanks.
Answer by efge · Apr 01, 2010 at 09:21 PM
Create a second camera and modify the values for the Normalized View Port Rect.
Attach the 'Smooth Follow' script (Component -> Camera Control -> Smooth Follow), set your player as target and modify the values for height, distance and damping.
You then have adjust the values for depth, clip planes and maybe the clear flags.
Also you could use layers to render only a part of the scene for your mini map.
This seemed to do the trick for a good makeshift Camera. Still working out the little bugs but it's working nonetheless. THanks!
Did everything as said. but the camera cannot be seen while playing. Should i add any GUI?
I don't know if this is solved yet, but for future browsers, you'll need to set the depth property of the camera to a higher level than your main camera. Cameras are drawn to scree "bottom up".
Answer by karl_ · Apr 01, 2010 at 09:01 PM
Just checked the Unify Wiki page for scripts, and came up with this:
http://www.unifycommunity.com/wiki/index.php?title=Radar
I've never used it but it looks like it has what you're looking for.
Answer by Janine · Nov 08, 2010 at 12:15 PM
What i did is just i created a second camera and fixed the values in the NORMALIZED VIEW PORT RECT, be sure to set the depth to 1 or if not higher to overlap the game scene. I placed the second camera high above to have a full view and placed flat circle objects on top of my player (make it higher than the character so the player wont see it) and also for the enemies. Its working but im having problems when screen resolution is changed.
Should use Camera layers ins$$anonymous$$d. That way the player has no chance of seeing the radar blip except from the $$anonymous$$imap.
Answer by kolmich · Oct 03, 2012 at 10:49 AM
Hi, you can checkout our KGFMapSystem in the assetstore.
Its a robust and easy to integrate minimap/map solution and it solves the most minimap problems out there. All our users are very happy with it and we deliver excellent support if you have any questions.
Your answer
Follow this Question
Related Questions
MiniMap with player and object icons 1 Answer
Map Camera 1 Answer
resetting the my default value for camera field of view 1 Answer
Can the Camera be Positioned on the Game Screen through code? 0 Answers
Camera placement / size behavior 3 Answers