So, I'm making a card game where I need to click and drag inside a Area2D in order to move the card. The tree node from the card itself consists of:
- Area2D # With a script attached (look below)
- TextureRect1 # Border texture of the card
-TextureRect2 # The image that the card has in the center
- Label # Some labels like name, description and cost
- CollisionShape2D # The collision shape made exactly the size of the TextureRect1.
With that said, I have connected the Area2D to itself with the Area2D's script beeing:
func _on_Card_mouse_entered() -> void:
self.position = get_global_mouse_position()
That's the only thing the whole card has, nothing else, what I can expect is that the mouse_entered only returns true when the mouse get into the border.
Thing is, I also tried attaching the mouseentered & mouseexited signals to the area and made it print a debug message, run the game and when the mouse gets in and out of the collision shape it does not send the debug print, instead, only sends the message when I click inside of the area, no matter if it is left or right. Seems like it needs to update or something. Is very weird and I have looked two times if anything under the collisionshape2D properties were changed but everything seems fine. I thought the order of the nodes caused the wrong behaviour...
If you have ANY idea of what is going on please send a answer, even if you don't really pin point the problem, anything helps. Thanks!