Changing an Area2D's CollisionPolygon while it is is intersecting another Area2D counts as a second collision

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Pyhrrous

See title; I’m designing a game around swordplay and the player character’s sword is set as an Area2D under them. The sword can be swung in different ways, each one with a different hurtbox shape, and these shapes are CollisionPolygons set as children of the Area2D, and are enabled and disabled based on which sword swinging animation the player uses.

Some of these animations can be extended, which gives the sword a second hurtbox that is only effective at the end of the animation. However, enabling the extended hurtbox immediately after the initial hurtbox is disabled will cause it to set off the area_entered signal on other areas, even if both the initial and extended hitboxes are both intersecting the other areas and they’re changed within a single function call.

Is it possible to have area_entered only fire when an Area2d enters it, and not if the Area2d inside it changes its collision shape?

I have figured out a workaround, but I’d like to ask if this is possible to avoid overcomplication.