Quick Start

beginner quick start

World Map 2D Edition · Quick Start

Quick Start (5 minutes)

Prerequisites: Unity 2022.3+ with any render pipeline. Import World Map 2D Edition from the Asset Store.

Step 1 — Import and Run Demo Scenes

  1. Import the asset into your project (or create a fresh project).
  2. Open any demo scene in the Demos folder.
  3. Press Play and experiment with the interactive map.
Tip: The demo scene contains a WorldMap2D instance (the prefab) and a Demo GameObject with a script showing how to use the asset properties from C#.

Step 2 — Add the Map to Your Scene

There are two ways to add the map:

MethodSteps
Menu Go to GameObject > 3D Object > World Map 2D Edition – Main Map
Prefab Drag the WorldMap2D prefab from Resources/Prefabs into your scene

A WorldMap2D GameObject appears in the hierarchy. Select it to view its properties in the Inspector.

Step 3 — Add a Viewport (Optional)

To render the map inside a cropped rectangular area:

  1. Go to GameObject > 3D Object > World Map 2D Edition – Viewport (or drag the viewport prefab from Resources/Prefabs).
  2. Assign the new Viewport GameObject to the Render Viewport field in the WorldMap2D inspector.
  3. The map now renders inside the viewport with proper cropping during pan and zoom.

Step 4 — Basic Scripting

using WPMF;

public class MyMapScript : MonoBehaviour {
    void Start() {
        WorldMap2D map = WorldMap2D.instance;

        // React to country clicks
        map.OnCountryClick += (countryIndex, regionIndex) => {
            Debug.Log("Clicked: " + map.countries[countryIndex].name);
        };

        // Fly to a country
        int spain = map.GetCountryIndex("Spain");
        if (spain >= 0) {
            map.FlyToCountry(spain, 2f, 0.1f);
            map.ToggleCountrySurface(spain, true, Color.yellow);
        }
    }
}

Next Steps

Was this page helpful?