Topic was automatically imported from the old Question2Answer platform.
Asked By
vania23
Is it possible to get a property (like var damage) from other node without get_parent and so on? like do func on_collision(body): body.get(property) or something like that. Thank you
To get the property of a node, you just need a valid reference to that node. It doesn’t matter how you get that reference as long as it’s valid. There are lots of ways to get a node reference, including get_parent(), direct scene tree navigation, via an in-built callback, signals, a singleton reference, …
With a valid node reference, you can reference the node’s properties directly.