Custom Resources don't update on exported project

Godot Version

4.4

Question

I use Custom Resources in my game to assign effects to items. When I update a value in any of my saved .tres effect custom resources, the values won’t update in exported versions of the project. This does not happen when running the project from the editor. I’m not using code to load these resources, they are all saved as .tres files and assigned to exported variables inside item scenes.

My custom resources look something like this

extends Resource
class_name ItemEffect

@export var damage : int = 0
...

and my item class like this

extends Node2D
class_name Item

@export var item_effect : ItemEffect
...

You can reproduce the issue like this:

  • Make a script that extends Resource with an @exported variable;
  • Make a resource from this script, modify the variable’s value and save it as a .tres file (let’s say Custom.tres);
  • Make a scene that takes your custom resource as an exported variable and assign Custom.tres to it;
  • Make the scene print() the modified variable (or show it on a label) and run it in the editor;
  • Change the variable in Custom.tres, save it and run the project in the editor again;
  • Export the project and run the exported version.

What I would recommend is changing Custom.tres to custom.tres and see if that solves your problem. If you’re exporting to Windows and you have any capital letters in your filenames, you get hosed when you export.


I already do that and don’t have issues. I use Resources for music and sound effects in my games. I made a plugin for it. They always play the right song/sound effect and the player updates the song metadata.

It’s a plugin with a test project you can play around with and compare to your own code. (Once 4.5 is released, I’ll be revamping my plugin to remove most of that because I don’t need the resources anymore, but thought it might be helpful now.)

I just used it in a game jam and had no problems.

I’m on Linux. Why would file names break on export?

AFAIK, they wouldn’t. So I’m back to, here’s some code that works that you can look at and play with. You could also create and upload a minimal project for people here to take a look at that reproduces the problem.