Minimap and world map

Add a minimap

Bake your scene first (see The Worldprint window). Then use either way:

  • the Add Minimap button in the Worldprint window, or

  • GameObject > Worldprint > Minimap.

You get a round minimap in the top-right corner of the screen, under the first Canvas of the scene (one is created if there is none). If UI of yours is already there, it goes to the next free corner (top-left, then the bottom ones). It shows in the Game view right away, without pressing Play. For a square one, use GameObject > Worldprint > Minimap (Square).

What you get

  • The map follows the player: the object tagged Player, else the main camera. If neither exists, you get a warning in the console; set Follow on the minimap and Target on its Player Icon yourself.

  • The map turns with the player, so what is ahead of the player is always up.

  • A yellow arrow marks the player at the centre.

  • A small triangle on the border, in the border’s colour, points north. It moves around the edge as the map turns.

  • The mouse wheel over the minimap zooms in and out.

Add a world map

GameObject > Worldprint > World Map adds a full-screen map framed on the terrain, with the player’s arrow. The player can drag it and zoom with the mouse wheel. GameObject > Worldprint > Map (Full Screen) is the same map without the arrow.

Open and close it with a key

The menu does not choose a key for you, because only your game knows its input setup. Untick the world map in the Hierarchy so it starts closed, and toggle it from your own code:

public GameObject worldMap;                 // drag the "World Map" object here

void Update()
{
    if (Keyboard.current.mKey.wasPressedThisFrame)   // Input System; Input.GetKeyDown with the old one
        worldMap.SetActive(!worldMap.activeSelf);
}

Put this script on an object that stays active, not on the world map itself.

Change size, corner, zoom and rotation

Everything is in the Inspector.

  • Size and corner: the map is a normal UI object. Move and resize it with its Rect Transform (anchors, position, width, height). The minimap starts at 280 by 280 in a free corner.

  • Zoom: how close the map is; each step doubles the size. Min Zoom and Max Zoom limit the mouse wheel.

  • Rotation: turns the map by hand (0 puts north up). Rotate With Target turns it with the followed object.

  • Round, Border Width and Border Color (under Look) change the shape and the frame. The north triangle takes the border colour; select North under the minimap to change its size, or delete it to hide it.

  • Follow is the object kept at the centre. Can Pan, Can Rotate and Can Zoom say what the player can do with the mouse.

Note

While Follow is set, the map cannot be dragged (the followed object sets the centre). Clear Follow for a world map the player drags.

Pin an icon on an object

Put Map Icon on a UI Image inside the map to pin it on a scene object, such as a companion or a quest target. Drag the object into Target. Options:

  • Rotate With Target: the icon turns with the object, so an arrow points where the object faces.

  • Hide Outside: hides the icon when the object is off the map (or outside the circle of a round map).

  • Hide In Fog: hides the icon while the object is in an unexplored part (see Fog of war).

Map can stay empty: the icon uses the map it sits under. The player’s arrow is a Map Icon too.

Note

Map Icon needs a map baked from your scene.

Make it a prefab yourself

The menu builds the minimap on the baked map of the open scene, because a ready-made prefab would not know your scene’s style. To reuse it, drag the finished object from the Hierarchy into your Project window to make a prefab.