Wanted behaviour: every time the player clicks, performing a melee attack, and the enemy and weapon's hitboxes intersect, you deal damage.
Actual behaviour: sometimes a consecutive hit does not trigger a new collision, thus not dealing new damage.
Probable cause: when the sword's box collider does not exit the collision at/before the end of a melee attack animation, AND does not start from outside the enemy's hitbox at the consecutive attack, there was never an OnTriggerExit2D, thus not calling a new OnTriggerEnter2D.
Possible solution: disable the melee attack's box collider for a single frame/(fixed)update call at the end of the animation?
Wanted behaviour: every time the player clicks, performing a melee attack, and the enemy and weapon's hitboxes intersect, you deal damage.
Actual behaviour: sometimes a consecutive hit does not trigger a new collision, thus not dealing new damage.
Probable cause: when the sword's box collider does not exit the collision at/before the end of a melee attack animation, AND does not start from outside the enemy's hitbox at the consecutive attack, there was never an OnTriggerExit2D, thus not calling a new OnTriggerEnter2D.
Possible solution: disable the melee attack's box collider for a single frame/(fixed)update call at the end of the animation?