|Topic was automatically imported from the old Question2Answer platform.
I’m learning Godot right now and I have the following Problem:
I have a Node with a script attached that holds a dict. with Int Values.
On Another Node I have a script attached with a static function that creates an Object from another Script which is not attached to any Node.
From that created Object I want to access the Node with the dict. and change Values.
get_node() doesn’t Work because the Object from which I access isn’t in the Scene Tree
Is it possible to access the dict. in some Way by that object?
Searched for quite some Time now and did not find any conclusive Solution, so I would be very grateful if somebody could Help me.
Hard to say what might be the best solution based on the limited info provided, but it might make sense to create / access the
Dictionary from a
Singleton instead of a specific object. Does that seem feasible?
If you did that, you could access the
Dictionary from anywhere else in your game…
jgodfrey | 2023-01-16 23:16
Oh that should work, didn’t know about Singleton yet.
Thanks a lot^^
Lenrow | 2023-01-16 23:19