Get path of child node added via code

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By fomere

Hey guys,

I got a code that adds a child node:

var coinIcon : Sprite = Sprite.new()
$Panel.add_child(coinIcon)

Is there a way to get the path of the added node? So that I can save it somewhere and use it later on.

Thanks.

:bust_in_silhouette: Reply From: kidscancode

You have a reference to the node already: coinIcon. Keep that reference if you need to use it again later.