Hello, how would I create a button out of an area2D? Here's what I have so far:
@onready var b1 = $character/button
func _ready():
b1.mouse_entered.connect(_on_b1_pressed)
func _on_b1_pressed():
print("here")
if (Input.is_action_just_pressed("ui_click")):
print("clicked")
"ui_click" is an input map I created for a left click. Code isn't working right now, though. However, the "here" is getting logged to the console whenever I enter the area defined by the collisionShape2D attached to the area2D, so I'm not really sure why the next line doesn't trigger when I click.
Can anyone help me out, I'm not understanding how to do this :/