1

How do I detect mouse clicks/mouse events in an Area2D's script? Do I use the func _process(delta) function? Let's say I have an area 2D called area. So what should the script be like? I want something like this:

extends Area2D


func _process(delta):
    if mouse_touching && mouse_left_down:
        print("clicked on object")
Coding_Guy
  • 160
  • 9

1 Answers1

1

If your Area2D has input_pickable then it will get a call to _input_event when the user clicks it.

Theraot
  • 31,890
  • 5
  • 57
  • 86