I have a Area2D hitbox set up to emit signals on body enter/exit and use it to hit enemies. The hitbox is always there and I check if there is an enemy inside when performing my hit/attack. It works ok, but it cannot hit multiple enemies, due to keeping track of only one enemy with the body enter/exit.
How do people solve this issue? Should I...
- make an array that keeps track of all bodys entering/exiting?
- disable/enable the Area2D, somehow, I tried this unsuccessfully...
- something else?
- create a brand new hitbox from code and hit all that enters, destroy box shortly after?
I know that I could animate a box to appear/dissapear to get that effect but I see myself not wanting to fidget around with animation player for each new hitbox as the project grows, I want all the manipulations to be in code.