> 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.
