How to activate an action using a collition as trigger?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Zero323

Okay, now it seems work.

I put two area2D, one for the joystick handle and other for the button

then, in the area2D button I connect a signal of type “area entered” and create this code:

extends Area2D

signal hit

var screen_size

func _ready():
screen_size = get_viewport_rect().size

func _on_forward_button_area_entered(area):
print(“activated”)
emit_signal(“hit”)

Now if the handle touch the button prints “activated”

How can I use this to activate the “dash” action that has the button?

:bust_in_silhouette: Reply From: Help me please

connect the hit signal and then you will get a new function. Use that to activate dash action.