I would like to use a specific node of a different instance within another seperate node, but don't really know how to go about doing it properly. The following statement I have resolved to use seems "hacky" and would love to hear a proper solution:
instance.get_node(old_node).replace_by(preload("class.gd").get_node(new_node), true)
The reason I am trying to do this is because I have multiple colour variations of the same sprite. And for each colour variation, a version of all animations associated with it (The animation is the same for all of them with the only difference being the colour of the sprite). I have separated any node data relating to each colour variation (AnimatedSprite Nodes) into separate instances (scene files), and would like to "import" whatever node data is necessary for the colour I choose to select within a separate script.
I think my question stems from a lack of understanding as to how GDScripts and Nodes relate to one-another, as well as to how to effectively use them together.
This is my first game with Godot, so I'm still trying to get my bearings with how to develop a game within the engine, as well as developing games in general.
Any help and suggestions would be definitely appreciated!