Enemy AI both triggering when entering just one of their radius

Hey guys,

I’m making a hack and slash game as part of a summer project. So far everything been going well, although now I’ve ran into a pretty big issue. I was hoping that someone would be able to offer some advice or help, i’ve been lost with this problem with a few days. I may be doing something quite basic wrong, such as work flow or it could be my visual scripting abilities. I’ve used a few AI tutorials as a learning tool, and then continued them on to achieve my result.

The problem - I have two enemy AI characters - one ranged - one melee. Once I enter the seek radius of either one of them, the other one triggers to chase me. Even though the other one is very far away, outside of his seek distance. I’m pretty stumped to understand why this is occuring, they are in different blueprint classes. I created the first (melee), then copied the blueprint and replaced/made new skeletal mesh, animations, blend space, etc. Is this a bad workflow? Should I be making the second AI from scratch again? They are both very similiar so I copied the first to save time. I have tried replacing then names of all the variables I’m using for each AI blueprint, but it doesn’t seem to change the issue of them both triggerings when I enter one of their radius. Although I feel like this is a major part of it. The desired result is, if the player is not within a close radius, the AI will just stand still.

Here is a video of the issue and screenshots of the blueprints for both and animation blueprints (but I don’t think these are the problem).
Any help on this would really be appreciated, I was going to continue to make the next enemy AI, but if I’ve done something drastically wrong I thought it would be worth knowing earlier rather than after I have created 5 more.

Thank you.

It looks to me that you are telling it to move to the player if it’s not attacking.

Hi ,

Thanks for the reply, I’m a little new to this. I was thinking that I was telling it to seek me if it wasnt attacking, but it could only find the player if it was X distance away. I don’t really understand why one of the triggers, when I’m close to the other. Even if he is really far away distance wise. Or am I reading the script wrong?

Ah, I feel pretty stupid. You’re completely right, I had two seperate nav meshes on each platforms, this was confusing me. I automatically thought the grunt could only see in their bounding nav mesh. I resolved it by making another collision box on the grunt, then setting a variable to true or false when I enter it, to then trigger the attacks. Seems to work fine. I think this is the best way to do it? Thanks for your guidance, and pointing me in the right direction - I was staring at it for way too long! :slight_smile:

Just incase somebody else wants the same setup I have, and dont want both characters to always seek the player, here is the fix.