Hi!
I’ve been following the course (Unity 2D RPG: Complete Combat System) and everything seems to have gone fine so far, but now I’m running into an issue with the collision detection. It seems that hits are only detected after I’ve moved the player a little bit.
In the picture below, I’ve walked the player to the enemy and swung my sword. This detected a hit, and logged the updated enemy health in the console, as expected. However, when I repeatedly swing my sword after without moving the player, hits are no longer detected. I haven’t moved, the enemy hasn’t moved (I disabled the enemy movement for this example).
When I move only a little bit and swing the sword again, it does detect a new hit correctly. Then, when I repeatedly swing without having moved, the same problem occurs.
Does anyone have any ideas what the problem might be? I’ve also added screenshots of my scripts below. Thanks in advance
DamageSource:
EnemyHealth: