Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Alena |
Hi (I am a newbie and wasn’t sure how to add images here so if they won’t show properly I added links to my drive)
I created Panels with shared script and attached different sprites as child nodes to each one:
https://drive.google.com/file/d/1elgQ6wspdnJWtg69JoS7H8vl4DjmCN8W/view?usp=sharing
I wrote the code to make the Panels react to where the mouse drags/drops them (alongside with their sprites).
Afterwards I also added Area2D to the scene.
My goal is to make the player drag a panel to this Area2D and when that happens, the visibility of this specific panel (and its child nodes) should turn to false.
Here is what I tried:
https://drive.google.com/file/d/1ZX8XvmcFZrIuCAj0UOchlNa6mvskMaJ-/view?usp=sharing
But this is what keeps happeniing when I run the game:
https://drive.google.com/file/d/1Ya2ctAicJsf7Yhc1isRwv0D33Czy79LS/view?usp=sharing
I know the problem is in the line
Panel.visible = false
But I don’t know how to write it correctly.
I will be happy for any help.