Hello guys,
Quick debrief:
I'm new to game dev and godot so I may be misunderstanding something on the way some of these elements operate.
I am trying to create a simple 2D demo for a point-and-click style game.
Currently I have a main scene with a background texture. In this scene I have two child Area2D nodes, each with a CollisionPolygon2D.
Separate of this I have a "Dialogue Box" scene.
My ideal workflow is that when the mouse enters any of the two CollisionPolygon2D nodes, a new instance of "Dialogue Box" would be created and appended to the main node, passing it a value based on which Area2D was that the mouse entered so that the "Dialogue Box" would display a text based on this parameter. This works.
The issue is that I can't find a way to "destroy"/queue_free the created instance once the mouse exits the Area2D polygon.
The current behaviour I see when moving the mouse over an Area2D polygon is of a flickering "Dialogue Box" which tells me the signal is being sent every time the mouse moves a pixel within the Area2D Polygon.
Intended functionality is:
Hover mouse over Area2D_1 > instance "Dialogue Box" with Area2D_1 related parameter > "Dialogue Box" remains while mouse remains in Area2D_1 > mouse moves out of Area2D_1 > "Dialogue Box" instance is destroyed
See attached the project files
Thank you for your help.