# Type to Prefab Mappings in Game Data Manager

{% hint style="info" %}
This guide was extracted from [GameDataManager](/save-and-load-add-on/content/03.-content/03.1-datapersistence/gamedatamanager.md)
{% endhint %}

### Type To Prefab Mappings

When loading instantiated objects, we only have details about their type and saveFields. Given this information, we can't instantiate the corresponding prefab for that type. To address this, we can establish a relationship between Types and Prefabs in the TypeRegistry, allowing us to read the Type and instantiate the associated Prefab. GameDataManager stores TypeToPrefab Mappings, so you can assign a Prefab to each type that needs to be instantiated.

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

{% hint style="danger" %}
To optimize performance and minimize overhead, include only necessary types in the Type-to-Prefab mapping. Avoid references that are unnecessary or unused.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://cowsinss-organization.gitbook.io/save-and-load-add-on/how-to-use-and-guides/type-to-prefab-mappings-in-game-data-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
