func _on_Area2D_input_event(viewport, event, shape_idx):
var body = false
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
if body == true:
body = false
elif body == false:
on_body = true
So I'm trying to make just ONE block of code run. What happens here is The elif statement would execute first, and then immediately after, the if statement code executes (probably because of the changed variable).
But I thought with if/elif, only ONE block of code runs.
I tried using RETURN but it still doesn't work.
I keep running into this problem and I don't know how to solve it. I'm so confused and would appreciate your help. Thanks a lot!