# 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="https://3475550444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWP70ItOegbJjXGyNP2E7%2Fuploads%2FcucB7OIIEqomYIROwxKW%2FSchermata%202026-02-25%20alle%2022.53.44.png?alt=media&#x26;token=99a96bfd-62be-4e21-8a27-38c90c2ad43e" 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.
