As an Associate of different 3rd parties, this website earns from qualifying purchases & contains affiliate links: learn more in the footer.

What is Unity GUID — How to Get & Change GUID?

Today we’ll figure out what a Unity GUID is and why it can be useful to you when developing games or assets for the Unity Asset Store.

What is Unity GUID?

A Unity GUID is a Globally Unique Identifier for the Asset (File) or Folder.

Folders and Files like Scenes, Prefabs, Animations and other Unity files (Assets) reference to Folder/Asset GUIDs to uniquely identify Folders/Files within a single project and between different projects.

Also, with the help of code GUID can be used for cross-scene referencing for Game Objects.

To simplify the text of this tutorial, I will use the terms “File” or “Asset” nearby the “GUID” term without adding a “Folder” term, because the Sense and the Structure of GUID for File and Folder are the same.

How to Get GUID?

GUID is generated by the Unity app automatically when you:

  • Import a New File into Unity Project with or without the help of the Unity app;
  • Duplicate the File (new GUID for the duplicated file).

GUID is originally written in the .meta file of the targeted file:
guid: 8c9c1e4a88e724a60a9ac0b0bb6a52c3 — parameter name and its value.

Unity GUID of File or Folder — .meta File

Previously defined Asset GUID with .meta file is always next to the targeted file when you:

  • Export a package from Unity,
  • Import files to the project with a .unitypackage file or from the Asset Store.

You can Get GUID by opening a .meta file in any text editor like Sublime Text or Notepad++.

Why change Unity GUID?

Under normal conditions, you do not need to change the Unity GUID. This is necessary when you are working with several projects and the files in these projects are being overlapped.

For some reason, the same file in different projects can have different GUIDs. In this situation, these are different files for Unity. When these same files (along with related files) with different GUIDs occur in the same (or new) project, there may be problems. In this case, you need to bring the same files to a single GUID. This is relevant when you are dealing with modularity.

GUIDs and Modularity in Unity Assets

Or, on the contrary, you may want to intentionally change the GUIDs for a file or group of files. It is relevant when you are making a new project (or a new file) based on an existing one (with the help of copy-pasting the folder of the project). At the same time, you change the files in the new project and want to identify them in different ways for further usage.

New GUIDs for some files in new project based on an existing one

How to change GUID?

Manual Mode

Example (Generate Unity GUID):

  1. guid: 8c9c1e4a88e724a60a9ac0b0bb6a52c3 — original.
  2. guid: 8c9c1e4a88e724a60a9ac0b0bb6ababa — modified in the end.

If you need to change the GUID for one file without related files, you can do it manually with the help of changing some digits and letters in the .meta file of the targeted file. Use only those characters that are already here.

If this file has “connections” with other files, these connections will be broken, so to save the “connections” you need to change this GUID throughout the project (in all places where this GUID is mentioned): e.g., in the .meta files of Scenes, Prefabs, and so on.

Auto Mode with “GUID Regenerator” tool

If you have to change GUIDs for the bunch of files, you can do it with the help of the “GUID Regenerator” tool.

“GUID Regenerator” is a tool for creating new Asset GUIDs for existing files inside a Unity Project. You can find it in a package of Tutorial for Asset Publishers.

Use “Menu > Window > Makaka Games > Regenerate GUIDs for assets in specific folder”.

Unity GUID Regenerator — Generate New GUID

It generates new Unity GUIDs for the selected folder: for all files here and nested folders including nested files. It doesn’t change references all over the project: if a touched file is used in the scene or in the prefab, the references will not change, so you will get a “Missing” warning in the Inspector.


Cross-scene referencing for Game Objects using GUID

There is an opportunity to use the next system: a special component for giving Game Object a GUID and a class to create references to objects in any Scene by GUID. Get with GitHub.


How to Create Unity Assets?

This article is a part of my Publisher Tutorial (PDF) in which I’ve systemized the accumulated knowledge and experience concerning the business in the Unity Asset Store. The web version is available here.

For Unity Publishers. By Unity Publisher.

Unity Asset Store — Download Button
Unity Asset Store Publisher: How to Create and Sell Unity Assets?

FAQ

How to Fix Unity GUID Conflicts?

To fix conflicts just assign different GUIDs in .meta files.

What is GUID in the Unity Project?

Every File (or Folder) in a Unity Project must have its own Identity Label (not a file name) aka GUID: Globally Unique Identifier for the Asset.

How to Find a Unity GUID?

Open your File Manager (Finder on macOS or File Explorer on Windows) that contains your target file in the “Assets” or “Packages” folders of your Unity Project. The folder of your file will also contain a .meta file with the name of your file. Open it in any Text Editor and you will see the “guid” field.

How to Create a New GUID in Unity Editor?

.meta file of your target file (that is visible outside Unity Editor) contains a “guid” parameter name with its value. To change the Unity GUID just swap some characters here.

Unity Assets

Support for Unity Assets

I am Andrey Sirota, Founder of Makaka Games and full-time Publisher on the Unity Asset Store. First, read the latest docs online. If it didn’t help, get the support.
Back to top button