GODOT can't save a empty resource

Godot 4.3

This issue has stopped the development of my game. I’m trying to fix it, but I can’t.

Screenshot_20250120-124842-111

This is a resource that I created separately. For now it only has variables for names.

This script belongs to a TextEdit. The function is to assign the name that the player writes to the resource variable. If it is saved, it outputs “success” otherwise it outputs “Fail”.

I’ve tried changing the method in several ways, but nothing has worked. When I run the project, it works, but if I try to save a name, it crashes. And in the debugger it says “can’t save empty resource to path”.

It’s been VERY frustrating

you are trying to save “IGN”, which contains a string and not a resource, therefore you recieve an error.

do you want to save “GN”? if yes then you should do the following:

GN.first_gameplay_name = text
var FGN = ResourceSaver.save(GN, "path/to/your/file.tres")
...
1 Like

I wanted to save the name to disk and the name is in ‘IGN’. Is there any other way to save this name to disk?

well you can create a resource-script which only contains a string, or a textfile and write it in there

1 Like

So I should make a string variable and have it edited in TextEdit and then save it?

Ignore, I DID IT! Thank you very much :3

1 Like