• Godot Help
  • How to link an exist node and show it on another place

Is there any way to copy a node to show on another place and auto update when original one is changed?
First I try to use Node.duplicate to copy, but the duplicated one didn't update when original changed.
Then I try to use Node.add_child to add the original one to a new node, but it seems can't work, I can't make a node has two parents

I guess this problem is popular, like you have an item as instance, and you want to show it on UI.
How you guys handle this problem?
Really appreciate your answers

  • As far as I know, yes, you will have to update the states of the copy to match. When you make an instance, it is an exact copy, but it doesn't move or change like the original unless you code that.

DaveTheCoder
Instance is absolutely ok, but tedius.
I will explain in detail.
I have a character scene. It has many states and each one owns a different texture.
Now I want this character to show on UI page, and when it changes state, I hope the copy on UI will auto update.
Of cource, I can instance or duplicate the character scene, and init it, and change its state manaually when original one changed.
I want to know is there any better way to achieve this goal
appreciate your reply

The article I linked gives an example of a Ball scene with instances. When a property of the original scene is changed, the instances are automatically updated. I did that tutorial when I was first learning Godot, and it worked, but I haven't tried to apply that in more complex situations.

As far as I know, yes, you will have to update the states of the copy to match. When you make an instance, it is an exact copy, but it doesn't move or change like the original unless you code that.