I making the touch controls, and I need that when the touch enters the area (Area2D for example) or being pressed in the area, then the variable is set to true. And when the touch leaves the area or being released, it is set to false. How can i do that? Thanks in advance!
I tried this, but it doesn't work when touch enters or leaves the area, it works only when touch being pressed or released within the area:
func _on_Area2D_input_event( viewport, event, shape_idx ):
if event.type == InputEvent.SCREEN_TOUCH:
print("Touch inside the area")
print("Touch outside the area")