> For the complete documentation index, see [llms.txt](https://multiset.gitbook.io/multiset/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://multiset.gitbook.io/multiset/multiset-quest-sdk/map-mesh-downloader.md).

# Map Mesh Downloader

The Map Mesh Downloader tool allows you to download and preview spatial mesh data directly in the Unity Editor, enabling precise content placement and scene setup before deployment.

## 📋 Overview

The Map Mesh Downloader provides developers with the ability to:

* Download actual spatial mesh data in the Unity Editor
* Set up content and objects around the real-world geometry
* Preview scene layout before building to device
* Optimize development workflow with editor-only mesh visualization

## 🚀 How to Use Map Mesh Downloader

### Step 1: Access the MapMeshDownloader

1. **Locate the GameObject**: Find the `MapMeshDownloader` GameObject in your scene hierarchy
2. **Select the GameObject**: Click on `MapMeshDownloader` to select it
3. **View Inspector**: The MapMeshDownloader component will appear in the Inspector panel

### Step 2: Download the Mesh

1. **Click Download**: In the Inspector panel, locate the **"Download Mesh"** button
2. **Initiate Download**: Click the button to start downloading the spatial mesh data
3. **Wait for Completion**: The download process will fetch the mesh geometry from the MultiSet servers

<figure><img src="/files/E3pyDFhVRss34cfzxFjw" alt=""><figcaption></figcaption></figure>

> 💡 **Note**: Ensure you have a stable internet connection and valid API credentials configured before downloading.

### Step 3: Mesh Organization

Once the download completes:

1. **Mesh Location**: The downloaded mesh will be automatically placed under the `MapSpace` GameObject
2. **Hierarchy Structure**:

   ```
   MapSpace (Parent GameObject)
   └── MAP_CODE (Children)
       └── TexturedMesh.obj
   ```

<figure><img src="/files/EU8ABO8NxvRNIE2gGx8z" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
*Do not change the Origin of the Downloaded Mesh file. It should always be at (0,0,0)*
{% endhint %}

## 🎯 Content Setup and Scene Design

### Positioning Content Around Mesh

With the downloaded mesh visible in the Scene view:

1. **Visualize Real Geometry**: Use the mesh as a reference for real-world spatial layout
2. **Place Objects**: Position your GameObjects, UI elements, and interactive content
3. **Align with Surfaces**: Snap objects to mesh surfaces for accurate real-world placement

### Best Practices for Scene Setup

* **Use Mesh as Guide**: Treat the downloaded mesh as a blueprint for content placement
* **Consider User Movement**: Ensure content is accessible from typical user positions
* **Account for Occlusion**: Place important content where it won't be hidden by mesh geometry
* **Test Different Angles**: View your scene from various perspectives to ensure good visibility

## 🏗️ Build Optimization

### EditorOnly Tag System

The Map Mesh Downloader implements an intelligent build optimization system:

**Automatic Tagging:**

* All downloaded mesh objects are automatically tagged as `"EditorOnly"`
* This tag ensures meshes are excluded from the final build
* Reduces build size and improves runtime performance

## 🔧 Workflow Integration

### Development Workflow

1. **Design Phase**:
   * Download mesh using MapMeshDownloader
   * Use mesh for spatial reference and content placement
   * Iterate on design with real geometry in mind
2. **Development Phase**:
   * Build and test with mesh excluded automatically
   * Content positions maintained relative to MapSpace
   * Runtime localization provides actual spatial data
3. **Deployment Phase**:
   * Final build excludes editor mesh automatically
   * Optimized build size and performance
   * Real-world mesh provided by VPS at runtime

### Editor vs Runtime Behavior

| Aspect           | Unity Editor                     | Runtime Build           |
| ---------------- | -------------------------------- | ----------------------- |
| **Mesh Source**  | Downloaded via MapMeshDownloader | VPS localization system |
| **Mesh Purpose** | Development reference            | Live spatial tracking   |
| **Performance**  | Preview/design tool              | Optimized for real-time |
| **Data Source**  | Static downloaded mesh           | Dynamic VPS mesh        |

## ⚠️ Important Considerations

### Mesh Download Requirements

* **API Credentials**: Ensure MultiSet API credentials are configured
* **Internet Connection**: Stable connection required for mesh download
* **Map Configuration**: Correct Map Code or MapSet Code must be set
* **Editor Only**: MapMeshDownloader only functions in Unity Editor
* **Unity Editor**: Tool only works in Unity Editor, not at runtime

### Limitations

* **Static Data**: Downloaded mesh represents a snapshot, not live data
* **Storage**: Downloaded meshes are temporary and excluded from builds
* **Network Dependency**: Requires internet connection for initial download

## 🛠️ Troubleshooting

### Common Issues

| Issue                | Cause                       | Solution                                      |
| -------------------- | --------------------------- | --------------------------------------------- |
| **Download Fails**   | Invalid API credentials     | Verify Client ID and Secret in MultiSetConfig |
| **No Mesh Appears**  | Incorrect map configuration | Check Map Code/MapSet Code settings           |
| **Network Error**    | Connection issues           | Ensure stable internet connection             |
| **Empty MapSpace**   | Download incomplete         | Try downloading again                         |
| **Build Size Large** | EditorOnly tag missing      | Verify mesh objects have EditorOnly tag       |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://multiset.gitbook.io/multiset/multiset-quest-sdk/map-mesh-downloader.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
