Displaying a minimap
In many games, a broader view of the scene can be invaluable for navigation and information. Minimaps are great for giving players that extra perspective that they may need when in first- or third-person mode. In this recipe, we'll first create a simple square minimap that appears at the top-right of the screen; then, you'll learn how to make it circular and add a rotating compass effect:

Getting ready...
This recipe adds to the scene created in the first recipe of this chapter, so make a copy of that project folder and do your work for this recipe with that copy.
How to do it...
To create a minimap, follow these steps:
- From the Hierarchy panel, create a new UI Panel object (
Create
|UI
|Panel
) namedPanel-miniMap
. Since this is the first UI GameObject to be created in thisScene
, new Canvas andEventSystem
GameObjects should be created automatically, and the UI Panel should be a child of the Canvas GameObject.
- With the
Panel-miniMap
GameObject selected in the Inspector,...