Deathmatch AI Knife Variant stops attacking

Jroo

New member
Hi, I am having an issue where the Deathmatch AI Knife variant will stop attacking after performing an attack once or twice on the player. It will only attack again once the target (player character) steps out of range, which causes the AI to chase the player and then repeat the same course of action as before. I've determine the issue lies in the fact that the knife's "Use" ability becomes active when performing the attack but then does not go inactive even after the attack has already been completed, remaining active until the player steps out of range or when the flee behavior is initiated via damaging the AI. Does anyone have any input on what can be done to fix this issue. Thank you!
 
If you enable logging on the AnimatorMonitor does the UseComplete event get sent?
 
I'm a bit inexperienced in animation in terms of unity. How would I go about enabling the logging
 
On the Animator Monitor component there is a toggle that indicates if you want to log the animator events.
 
Ok, when I do so, after the attack, I do get a log saying "Execute OnAnimationUseComplete on GameObject BFKnifeAI Variant(1)". Does that indicate my initial assessment of the issue was wrong or could there be another factor at play resulting in Use never going inactive.
 
After the complete event is sent the ability will try to be stopped. If you place a breakpoint within Use.UseCompleteItem can you tell where it returns early? stopAbility should stay true.
 
What script is Use.UseCompleteItem in? Also, is there a better way to communicate with support? I feel this issue could be resolved much faster if it were possible to have a call with you or someone else while I share my screen.
 
That's the Use ability, so Use.cs. It's on line 811 in my project.

Unfortunately due to my support load I am not available for realtime support.
 
Ok, when I put break points throughout the UseCompleteItem function, I get that StopAbility() is never called as bool stopAbility becomes false before it reaches that point due to the if statement on line 831.
 
Ah, that's probably the m_CanStopAbility bool, correct? If you set the Stop Use Ability Delay to 0 on the Shootable Weapon does it work?
 
Where would I got about doing this? In Use.cs or somewhere on the inspector? Also, yes, it is the m_CanStopAbility bool.
 
You should change this on the actual knife GameObject within the inspector for the Shootable Weapon.
 
Ok, I did so and the AI works in that it will keep attacking the player after the first attack but obviously there is no delay between one attack and the next one. If I set the Stop Use Ability Delay to extremely low numbers, it will keep attacking with some delay but the delay is very inconsistent and is extremely long when using values above 0.005. I will send an image of the values I have set for reference
 
Top