AI lock on ENEMY

Hi everyone! My AI can chase multiple Enemy AI with no problems except for locking on to the target. When the AI sees me sometimes it will not chase me because there is my Ally right behind it. The only thing the AI will do is rotate towards me but as long as my ally is right behind the enemy then it will not move. Is there any way to fix this?

Also I have a screenshot of my behavior tree

Hi, I don’t have enough information to tell you whats wrong (e. g. how you set the blackboard keys and which branch it executes). What you could do is:

(-) play the game in the editor and use the AI debugger AI Debugging | Unreal Engine Documentation

Then look at the values of your blackboard keys and what it executes as the behavior tree runs in the game and compare what you expect the blackboard values to be and what they’re actually are.

(-) do some prints in your AI perception / the rest of the logic the AI debugger does not show. I would first find out though which blackboard values are not as you expect and then looker closer at those.

Here I provided more screenshots and I named the black board condition to help! I would also like to mention how I have multiple AI and when one from Team2 starts to chase me it will stop at a certain distance then just rotate towards me. This can also happen when there is a AI from team 1 right next to Team2 AI.

The first thing you could do is figure out what blackboard keys are not set as you expect them to be (e. g. using the AI debugger tool and/or watch the behavior tree and blackboard values as the game runs in the editor). Then as you know what blackboard keys don’t have the values you expect them to have you can look into the code where you’re changing them. Then you can do some prints there to try find out what causes them to get the wrong values and then change that logic.

I found the problem. It was not the blackboard keys. It was something with the collision that affected the nav mesh. It still does the problem but not as often as it did before and even if it does do the problem it means the AI is trying to move to something different.

Fixed it. I just messed with the collision settings.