Enabling Area2D collision/layer masks doesn't trigger area_enter on overlapping Area2D?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By markopolo
:warning: Old Version Published before Godot 3 was released.

Using 2.1.3 stable, windows 7 64 bit
Not sure if this is user error/intended behavior/bug. Example project here

There are two Area2Ds that overlap, but have no mask bits in common. When I enable collision between them by adding a common mask bit, the area_enter signal isn’t emitted by either.

export(int) var layer_bit = 0

func enable_hitbox():
  set_collision_mask_bit(layer_bit, true)
  set_layer_mask_bit(    layer_bit, true)

However, if I “move” the area whose mask bits are not being modified:

func _fixed_process(delta):
  set_pos(get_pos())

Then the area_enter signal get emitted by both when collision is enabled!

Not sure if pulling the set_pos() trick on the other area2d works as well.
Not sure if the same is true for body_enter and non-moving bodies.
Not sure if this is a timing thing - half a second seems like plenty of time
Not sure if it’s because I’m using a timer or misunderstanding yield behavior

Sounds like a bug to me, similar to this Looping animation with collision:shape:radius/height causes Area2D not trigger · Issue #8325 · godotengine/godot · GitHub

Can you try the 2.1.4 beta 2? there were many changes on the way areas work.

It could be out of sync too, maybe you can try to execute the enable_hitbox during a fixed process to see what happens.

eons | 2017-08-17 01:58