Agent not attacking

strange_aeons

New member
I have the death match AI setup on one of my characters equipped with a rifle i made and what seems to be happening when it sees the play is that it runs towards them and then when it reaches the player it runs off to one of the waypoints in the scene. it i hoped it would attack the player, but it always runs away. does it not know that it has a weapon?screen37.png
 
i started going thru again following that video and at 10:58 found some steps i had missed, adding the weapon to the death match component on the agent and setting up the range for it etc.

now when i have done those things, and i run the run, the agent walks around to his waypoints, but when he sees the player, the agent does point his gun at the player, but both the agent and player are stuck in running animation, unable to move as if the game has been paused exc ept that its not paused.

trying it again and jumping just before the agent sees the player results in the player being stuck in mid air even though the game isnt paused. not sure what to make of this.

screen38.png
 
C#:
else if ((m_StopType == AbilityStopType.ButtonUp && !playerInput.GetButton(m_InputNames[i]))

Is the line caught first, so check if playerInput is not null, and also and likely m_InputNames
 
m_InputNames is defined in the inspector within the ability. You likely have not defined input, but cannot say that fore sure.

playerInput I will assume is ok as it is fed in via parameter
 
m_InputNames is defined in the inspector within the ability. You likely have not defined input, but cannot say that fore sure.

playerInput I will assume is ok as it is fed in via parameter
Yes, if its giving errors with that then its likely a bug. @Justin I think this one may need your professional take :)
 
Try looking at the very first error and fixing that. Sometimes later errors are caused by the first so you should always fix the first, first.

When you see the error you can place a breakpoint on that line and determine what is null. From there it's easier to determine what went wrong.
 
Top