Layer Control of HitArea2D from Animation

Currently, the layer settings for the player object’s hitArea2D are:

Layer 1, Mask 2

When set normally, it collides, triggers the damage animation, and activates invincibility frames.

If set to Layer 0, Mask 0:

It does not interfere with enemies.

However, when modified via AnimationPlayer:

Standing animation: Layer 0, Mask 0 from frame 0

Walking animation: Layer 1, Mask 2 from frame 0

It should not collide while standing but should collide while walking, yet it behaves strangely like this.

1 Like