Problems with agents not shooting at player, they are stuck at aiming

Hi,

This problem is likely similar to this problem, but the solution doesn't seem to work for me. Whenever my agents see the player, they clearly identify the target, equip their weapon and aim, but the weapon is not firing. This might be related to the Use ability. I have ensured that the layers are correct for the enemies (since the agents are aiming at the player, the layers should be correct). I have also checked the Use ability and it is set to use slots -1, so all available slots. Since I only have weapons in slot 0, I did put 0 just to check, still nothing works. In addition, I have set the Use ability to automatic and the bots are firing at the player, but they won't stop. Are there any other possible reasons why this behaviour is occurring? Any suggestions would be appreciated. Thanks.
 
You're creating a networked game, right? Do you also have the problem in an unmodified project without networking? In cases like this I always set a breakpoint within the Use ability's update method to step through why it isn't firing. It's hard to say because there are so many things that can go wrong.
 
You're creating a networked game, right? Do you also have the problem in an unmodified project without networking? In cases like this I always set a breakpoint within the Use ability's update method to step through why it isn't firing. It's hard to say because there are so many things that can go wrong.
Yes, it is a networked game. The agents worked fine without networking, as well as using Photon's offline mode. They also worked in a networked scenario. What happened was I reimported the entire project and changed a few layers, and now the agents don't seem to want to shoot. Prior to this, everything was working fine, both offline and online. I haven't changed anything about the agents, except for updating the layers since they were changed. I did do some debugging within the Use ability. What I found was:
  • CanStartAbility was true
  • AbilityStarted was true
  • The itemStartedUse was true
  • Schedule use event for slot ID 0 was also fine
  • Update and LateUpdate did not fire at all
  • OnItemUse and UseItem were not being called
  • StopAbility is not being called
So it seems to be a problem somewhere during AbilityStarted() as far as I can tell. And they definitely do have ammo, because if I set the ability to be Automatic, they will fire continuosly.
 
If Update isn't being called then it doesn't sound like the ability has started even though it returns true. Does the ability show as active?

One thing which may be easier to try is reverting your layer change commit just to get it working again. From there you can make your layer changes and see what ends up breaking it. This will give a better clue as to the cause and will probably be easier to debug.
 
If Update isn't being called then it doesn't sound like the ability has started even though it returns true. Does the ability show as active?

One thing which may be easier to try is reverting your layer change commit just to get it working again. From there you can make your layer changes and see what ends up breaking it. This will give a better clue as to the cause and will probably be easier to debug.
Hi Justin, renaming the layers does nothing, I also tried recreating the bots from scratch using the standard process, but they still can't seem to fire. Not sure what is happening here, I will also check the ability.
 
Hi Justin, I solved this by creating a second Use ability for slot 1, and changing the first one to slot 0, just like with Agent Aydan. What confuses me is that before reimporting, I didn't have to do this for them to shoot at the player, and after reimporting my project, I didn't change anything about the bots except for the layers :unsure: Why would a single Use ability of slot -1 not work in this case? A bit strange to be honest, I probably should have tried out separate Use abilities first, but for some reason I was sure the issue lay elsewhere. Nonetheless, thanks for the assistance as always (y)
 
Top