How to fix invalid UID warning?

Godot Version

4.5.1

Question

I copied some resources from another project into this one. Now I’m seeing warnings like this:

  WARNING: scene/resources/resource_format_text.cpp:444 - res://scenes/compute_nodes/world_map_generator.tscn:3 - ext_resource, invalid UID: uid://ccqo14fquuoop - using text path instead: res://scenes/compute_nodes/world_map_generator.gd

How do I fix my UIDs? I think if possible I could just recreate them since these objects were previously in another project.

If you go to Project → Tools, you should see an option called “Upgrade Project Files”
This will also re-generate UIDs, I think you should give it a go after you back up your project.

I did that twice, but it doesn’t look like it helped. I still have a lot of ext_resource, invalid UID errors.

Two ways to fix this:

  1. Open the scene and save it. Godot will generate new UIDs.
  2. Go to Project → Tools → Upgrade Project Files. Godot will update all UIDs in your project.

Same issue here. The fix for me was deleting the hidden .godot folder in the project directory while the project was closed, before running the Upgrade Project Files tool mentioned above. The tool alone didn’t seem to clear the invalid UIDs from the UID cache.

I had same issue scenes with attached scripts sometimes you need to detach script and attach them again and problem then will be solved.