AI Not Attacking AI

Hello again everyone!

I’ve got an odd one here. I’ve been working with AI trees and have had some success with simple concepts. I can get AI to follow me on sight, attack me, heal me, and follow another AI. BUT I cannot get the AI to attack another AI.

I have tried numerous setups - I’m just going to show you the one that has netted me some results so far. With this current setup I’ve had the AI strike the target 5 times, but I cannot replicate.

This behavior tree has an additional “Simple Parallel” compared to the Cleric (ally) and Warrior (enemy) BTs. For the cleric it’s “Follower Player” paralleled with “Heal Player” and it works - I actually had to learn how to setup cooldowns to slow it down significantly as it would spam faster than it could animate. Same with the Warrior where “Heal Player” is replaced with “Attack Player.”

I tried to establish a similar effect with my Assassin - to follow me and locate an enemy, then follow the enemy and attack the enemy. I’ve tried to setup a “HasSeenEnemy?” bool to force all behavior down a third tree I tried to place in front of all of the other trees with a detractor that checks for that bool. No luck. Same results as everything else - follows the enemy AI but does not attack.

Here is my attack sequence for the AI Assassin. I know it’s rudimentary and needs to be cleaned up. This is how I understand the system at this time.

Let it be known that this setup works to allow my player to attack the enemy AI, the enemy AI to attack my player, and for my healer to heal my player. I have had the Assassin land a total of 5 hits but could not replicate. Three of the hits occurred in a row, but for some reason the hits just stopped landing.

I have tried to set the “HasSeenEnemy?” bool the same way I’ve set the “HasSeenPlayer?” bool, but it is not working. Unfortunately, I don’t know how to tell if it is or is not set and every time people talk about tools they just throw out their names like its supposed to make sense to me. I don’t know how to do anything more than Print Strings at this point, and I’m well aware I should learn another troubleshooting tool as that’s likely the most basic troubleshooting tool there is, but I’ve no clue where to start.

I’ve been researching for HOURS and I can’t find anything helpful. There were two or three threads related to ai collision and breaking BTs, but I resolved that - as far as I can tell - and it didn’t seem to have an impact on this issue.

If you can provide any insight or point me in a direction for me to review some information I might not know or might have overlooked, then I will be incredibly grateful!

Thank you for your time.

Here is the other BT that I got the other two hits out of. Not consecutive hits and I cannot replicate.

Update! I found a solution that works. However, now I’m having an issue I had previously that I cannot figure out how to fix just yet. My AI will break their BT when they get too close to the enemy AI they are following. I can set a follow distance when they follow me, but I can’t figure out how to set one when they follow another AI.

Here’s my tree that works! So long as there is no delay in the attack, my Assassin will destroy the Warrior AI. If there is even 1 second delay, then they only do the first attack before no longer attacking - note that they do continue to follow their target.