> For the complete documentation index, see [llms.txt](https://tools.continis.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tools.continis.io/subassets-toolbox/editor-workflows/patch-references.md).

# Patch References

When creating or relocating a sub-asset, SubAssets Toolbox can patch references to it in the entire project.

{% hint style="warning" %}
Because patching references is an operation that involves non-Unity-supported API, it is recommended to have the project under source control before using it.
{% endhint %}

## Context

Why is patching references even needed?

* When a sub-asset is created, and added to another asset, it loses its GUID and from now on, is identified using its parents GUID + an assigned FileID.
* When a sub-asset is removed from its host asset and made a main asset, this new one loses its parent's GUID and the FileID, and receives a new GUID.

For these reasons, creating or relocating a sub-asset will **invalidate** **all references** to the asset involved. Sometimes this is not an issue, but other times it can lead to a lot of work trying to track down the dependencies and fixing them.

## Patching references

SubAssets Toolbox has a feature to "patch references" by looking into all files that could hold a reference to the moved asset, to swap the GUID + FileID with the new ones.

When you relocated a file, you will be prompted if you want SubAssets Toolbox to do so for you:

<figure><img src="/files/fLUDjWbapA0rStQs1Yn0" alt="" width="372"><figcaption></figcaption></figure>

Since this feature scans all applicable files, it can be taxing in big projects. You can set the behaviour in Project Settings, where you can decide whether to always auto-confirm patching, get asked each time, or disable it completely.


---

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

```
GET https://tools.continis.io/subassets-toolbox/editor-workflows/patch-references.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.
