AI stops Shooting after reload

Gwynbl31dd

New member
Hi everyone,
I made custom character and added the Deathmatch AI behavior to it.
After a reload, the character does not shoot (From what I saw, it is blocked waiting for the Use ability to finish... Which never finishes)
The Reload ability works as expected...
So I found a simple solution, blocking the Use ability when I reload. Then the AI continues shooting as expect.


C#:
public class AbilityBlocker : MonoBehaviour
    {
        private UltimateCharacterLocomotion characterController;

        private void Start() {
            characterController = GetComponent<UltimateCharacterLocomotion>();
        }
        
        //Block the use ability when the character is using reload
        public void OnAbilityReload(Ability reload, bool active)
        {
            Reload reloadAbility = reload as Reload;
            if(active){
                characterController.GetAbility<Use>().StopAbility();
            }
        }
        
        
    }
I hope it can help others :)

Cheers,
 
Top