I tought the bug was caused by the “stopAttacking” trigger getting activated after an attack and staying active after moving, which is actually what I still think the bug is. So I did try to reset the trigger by adding a "Animator.ResetTrigger(“stopAttacking”) right before the MoveTo(destination); instruction in the Mover script. But then the animation wouldn’t get cancelled when moving away while attacking, yet somehow, resetting the “attack” trigger does the job. The character correctly stops attacking when moving away and at the same time the “canAttack” trigger doesn’t stay active. It works perfectly but I know this wasn’t the correct solution I was supposed to implement. Most problably I had to reset the trigger somewhere else.
I’ll proceed with the course now and I’ll correct my code with the correct solution, because most problably what I did is going to cause problems in the future (otherwise why implement the “stopAttacking” trigger in the first place if we could just have done this?)