Quick Start
beginner quick startWorld 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
- Import the asset into your project (or create a fresh project).
- Open any demo scene in the Demos folder.
- 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:
| Method | Steps |
|---|---|
| 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:
- Go to GameObject > 3D Object > World Map 2D Edition – Viewport (or drag the viewport prefab from
Resources/Prefabs). - Assign the new Viewport GameObject to the Render Viewport field in the WorldMap2D inspector.
- 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
- Inspector Reference — full property breakdown
- Viewport Feature — learn about viewport rendering and screen overlay mode
- Scripting Reference (C#) — complete API documentation
Was this page helpful?
Suggest an improvement
Help us improve this documentation page.