I am working through the RPG Core combat course,
in the main Attack / Fighter script in RPG.Combat, I have a LookAt(target.trasnform) method on the attack behavior.
The problem is that When the enemy dies, he keeps turning on the ground to follow my player.
I fixed the problem by checking in every Update method, whether or not the attacker is dead and only then attacking (referencing Health script in the Fighter Script.)
I know that this is No-no… But not sure how to solve this.
I know that this is not the best method, because it creates a circular dependency
What is the better way to approach this? Thank you