Mouse_entered not being detected on copied Area2d?

Godot Version

4.3 stable

Question

I have an info panel, which is a Control object, with several sprites and labels inside it, on a CanvasLayer in my World Scene.

Then, in the same World scene, I have a Node with an Area2d attached. The Area2d has a CollisionShape2D that covers the Area I want to detect. Attached to this same Node, I have a script, in which I connected the mouse_entered signal of the Area2D to make the info panel visible when the player mouses over that node. The info panel has a Unique Name and is referenced in an OnReady var in the script. This works fine and when I mouse over the node, the panel shows as expected.

The problem begins when I make a copy of the Node. Now the mouse_entered signal is only being detected on the copied Node, not on the original node. If I make multiple copies, the mouse_entered signal is only being detected on the last one created.

I made the CollisionShape2Ds unique for each pasted instance and that didn’t change the problem. I don’t see a way to make the Area2Ds unique.

What could be causing this?

edited to add further information After putting in some debug prints, the mouse_enter signal is being sent and received. The code is even going to the func where it turns the UI panel visible. It just fails to do that, except on the last one copied.

If I’m understanding this right, you are duplicating items, which unfortunately can cause some odd quirks. You would expect that each new duplicate is an independent item, but as far as I know at the moment some things can have shared resources which can cause them to behave not as expected. I believe this has been discussed to some degree in bug reports on Github, and may change at some point in the future. For now the best I can suggest is if something isn’t working as you want after a duplication, delete it and create it from scratch. Sorry it’s not more helpful, although someone else may be able to shed some better light on it.

Thanks for the info. I went back and recreated each of the items from scratch, without duplicating any of the pieces. The issue persists - the last one I created is the only one that sets the UI panel visible, even though they are all registering the mouse_entered signal. I’m going to have to come up with another way to do this, I guess