• Godot Help
  • Duplicated resources return empty resource_path

After duplicating a resource at runtime, resource.resource_path returns empty is this an intended behaviour?.
How can I find a path to the original resource.tres file from a duplicated resource?

  • I suspect that the path is filled in by the editor, when you duplicate it there. It kind of makes sense that you wouldn't have a path in a duplicate. The easy answer is to copy the path name when you duplicate them in code. I'd make a new property with set_meta() to store it, just in case setting the actual path caused problems.

llHate changed the title to Duplicated resources return empty resource_path .

I suspect that the path is filled in by the editor, when you duplicate it there. It kind of makes sense that you wouldn't have a path in a duplicate. The easy answer is to copy the path name when you duplicate them in code. I'd make a new property with set_meta() to store it, just in case setting the actual path caused problems.

    duane I tried to manually set the resource_path property at runtime but it didn't store it. Storing it as meta data should work, thanks.