Duplicate C++ error

Godot Version

4.7.1

Question

Hi all,

I keep getting the following c++ error while running my game. I don’t understand what’s causing it and am unable to resolve as it comes from the c++ part which never gives your explicit error messages:

E 0:00:05:212 place_preview.gd:24 @ _display_preview(): Condition “!duplicated_node” is true. Continuing.
<C++ Source> scene/main/node.cpp:2859 @ _duplicate()
place_preview.gd:24 @ _display_preview()
game.gd:214 @ select_stone()
hand.gd:56 @ _unhandled_input()

It is generate by the following godot script line and using the DEFAULT flag makes no difference.

_preview = _stone_being_previewed.duplicate(DUPLICATE_USE_INSTANTIATION)

Does anyone know why its caused and how to resolve it? The github code link is this.

Thanks!

What is _stone_being_previewed?

It’s a script attached to a PanelContainer.

I think they wanted to know what said script contained, they most likely knew it was a node and a script attached to said node.

What happens if you do duplicate(DUPLICATE_DEFAULT & ~DUPLICATE_USE_INSTANTIATION) ?

Thanks, that worked! Your flags mean default - instantiation? Why does that work?

Hard to tell without inspecting the scene tree.