Topic was automatically imported from the old Question2Answer platform.
Asked By
Forward
Can someone explain to me why both of these are triggering at the same time?
If this area is touching both tiles and a player at the same time the elif seems to be getting read first. How come the first if statement is not getting read and not setting added = true? That should then stop the elif from running or is my logic off here?
func _on_Area2D_body_entered(body):
if body.is_in_group("tiles"):
added = true
queue_free()
elif body.is_in_group("player") and added == false :
queue_free()
wait_seconds(1)
player[0].velocity.y = -350