I’m making an area type battler where enemies come up next to you, and you can click to attack them with your sword. Only OnCollisionEnter won’t work all the time because sometimes when you attack, the enemy is already within the collision box. Also, OnCollisionStay will get triggered multiple times. I thought about possibly making a boolean to flag once something has been hit once, but that might be a bit messy if there are multiple attacks with different timings and such.
Is there an easier way to trigger a collision once regardless of whether the collision is already inside the box or not without additional manual work?
As was suggested above, keep track of all the enemies you have hit. In case of multiple attacks / combos just set them up so that each attack increases a counter and use that to disable an enemy from getting hit by each attack multiple times.
“Hit X enemy with my 0 attack, if my attack is now 1 it can get hit again” and etc.