Duplicating inherited scenes: Weird behaviour

Setup:
I have a base tower scene from which I create inherited scenes. For example beam tower:
tower

TestScene:


BeamTower4 is a duplicate (ctrl+d) of BeamTower3, everything else was intantiated using the instantiate button.

Issue:
The Firepoint of the duplicate tower 4 is the same object (same object id when running) as the tower 3s. The beam from tower 4 (bottom right) therefore fires from tower 3 (bottom left) firepoint. Targetfinder and other things are different objects.


Is this expected behaviour?

If so, why is only the firepoint the same object? Because it’s not a packed scene? And how would you quickly create “real” duplicate instances? pressing ctrl+d 10x is faster than draggin them into the tree one by one.
This is confusing. What purpose does this behaviour serve?

If not: hmmm, don’t know.

You’re not the only one that’s confused about this mode of behaviour for duplication in Godot.

Unlike most software, Godot uses the same references (external and sub-resources) from the source object that is being duplicated. While it makes perfect sense for external resources, it is quite confusing when a duplicated object references sub-resources from its source.

Here are my suggestions to avoid this issue:
For packed scenes: use Ctrl+Shift+A to add a scene instance
image

For unique objects: use Ctrl+D and then make sub-resources unique
image

Alternatively, you could opt to not use sub-resources but instead external resources only.
This should avoid the issue of having objects that are “linked” through shared sub-resource references.

EDIT: I just realized that the problem you’re having is with an actual node being used across instances, not a resource. Perhaps this is an actual bug?

In case this has been changed in the future: please dismiss this post.

1 Like

Thank you for your help! :slight_smile: I will test this behavior further when I have time.

EDIT:

This one was opened 2 days ago if someone is interested: