godot icon indicating copy to clipboard operation
godot copied to clipboard

Add `Node.get_unique_node()`

Open Mickeon opened this issue 3 years ago • 0 comments

Implements https://github.com/godotengine/godot-proposals/issues/5048

This PR adds a new method to Node called get_unique_node(). The code is almost copied and pasted from part of get_node(). However, unlike the latter that passes through a NodePath, this method requires a StringName name as argument, and accesses the owned_unique_nodes directly.

Also updates description of find_child() and find_parent() to mention get_unique_node().

Currently a draft because I don't know if this even works. I am, at least currently, unable to compile a version of Godot to test this out. If someone were to test for themselves, I'd appreciate that very much.

This can probably be backported or cherrypicked to 3.x with no issues.

Mickeon avatar Aug 07 '22 00:08 Mickeon