To stop shooting a dead horse

I noticed that after Rick’s fixes, the Player will continue shooting arrows after the enemy is dead. While I was content enough for may be 1 arrow to be in flight after the target died, I thought it was a bit odd to see the Player still going through the animation of firing an arrow after the target was dead.
This, thankfully, is a very simple fix Fighter.cs, making use of our Cancel function:

      private void Update()
        {
            timeSinceLastAttack += Time.deltaTime;
            if (target == null) return;
            **if (target.IsDead()) Cancel();**  //changed from return
            CheckDistanceAndMove();
        }
2 Likes

Thank you for this

I was already returning in this case, but doing Cancel() actually seems to be even better.

Privacy & Terms