What would you say is the best way to do a meele-attack?
When i press LMB i swing my weapon. I am thinking of just instantiating a collider somewhere along the swing-sprite for as long as the swing-sprite is in the universe. The swing-sprite collider detects enemy-colliders and damages the enemy that touches this collider. Are there any other way of doing this that is better? Performance-wise and gameplay-wise.
I think that should work well but donβt instantiate a new one every time that you swing your weapon, just enable at the beginning of the swing and then disable after the swing.
Please dont instantiate colliders for melee attacking or so, that can turn complicated later on. Use raycasting instead, its more useful, if the player is in range of the raycast, you can remove health of the enemy (attacking)