Add a way to reference the parent resource from a sub-resource #8506
peachey2k2
started this conversation in
Scripting
Replies: 1 comment
-
Resources are shared, so there's no one parent resource, this wouldn't work except specific cases where exactly one parent exists More generally this kind of use of resources is not how they are supposed to be used, they aren't supposed to know "where" they are If you do need to know this relationship then what you need is not a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Godot's node system works so well because they have so many ways to communicate with each other. One can for example:
move_child(get_child(0), -1)
Node.get_children()
This system is pretty good, but not having that sort of thing for custom resources is pretty annoying. Yeah, I can just hold a reference to
Node.get_tree()
in a singleton, but that still only works for nodes. At the moment, there is no way that I know of to access from a resource to another that is one level higher without doing some pointlessly complicated coding (like turning the main resource to a tool script and having a setter for the other resource that pssses the reference) where we could just have a function similar toNode.get_parent()
but for resources.Beta Was this translation helpful? Give feedback.
All reactions