Topic was automatically imported from the old Question2Answer platform.
Asked By
ashish
How can I call a signal within a signal?
I want to implement:
-if a touchscreenbutton has been after pressed.
only after that
-if an Area2D area is entered (through a collisionshape2d), body entered signal is generated.
Use a boolean to keep track of which conditions have been fulfilled:
var button_pressed = false
func _on_TouchScreenButton_pressed() -> void:
var button_pressed = true
func _on_Area2D_body_entered(body) -> void:
if button_pressed:
# ... enter code here