EQS: How to find the AI that is the closest to the player

ClosestAI is set to “None”

Can you send a picture of an EQS test pawn testing your EQS near some of your AI?

The test pawn is the one that is selected. Every other actor in the level returns blue, except for the foxes

The big collision spheres are just there to check for overlap/and if the player is chasing the AI :slight_smile:

Can you temporarily disable the visibility trace on your EQS?

this is with it disabled:

Are you still using the GetAllActorsOfClass ? if yes maybe try indicating the AI class instead of Actor

Yes I am! I’m getting the master class that all my AI is parented to

Are you testing while playing ? because it needs to use the player as a reference for distance.

I’ve looked at the keys to see if they change, and only the “SelfActor” responds with a value it seems. I also tried to plug the sequence directly to the “compare bb entries” node but it keeps going red, so it doesnt continue to the sequence

This is the “compare bb entries” node:

image

Can you add 2 prints here to confirm that the timer is working at least ?

oh lord that reminded me - i did not plug it into begin play :sleepy:

:smiley: Let’s see if it works after you connect it then

Still comes up as “none”

I’ll try real quick with the print strings

EDIT:

I have mine set up as the screenshot from Zeaf, but no it doesnt print anything.

And yes this is set up in the character BP

While the game is running, open your character’s blueprint, select your character here
image
and monitor the flow in the GetClosestAI event
Is execution stopping at the IsValidIndex branch?

Also I sent an updated version of the graph here

Yes it stops at the “Is valid Index”, I’ll also take a look at the update version!

EDIT:

I updated it. Sorry didn’t see it before.

Now it stops here:

image

And it doesnt print anything still. I hooked the “compare bb entries” node to the root too, to check if something else in my code was interfering, but still doesnt print

It means the EQS is not returning anything, can you disable the visibility check and only leave by distance, also if you can show how your EQS is setup currently ?

image

Then its hooked up here:

The “BTS_IsFriendly” is a check I have to make sure I have the right stuff on before it goes true. It does go over to the “compare bb entries” but again doesnt print anything and the entry goes red

and this is the entry:

image

Change the context of the Actor generator to Querier

Still runs red, doesnt print and “closestAI” is still “none” and it still stops in the player character at the “get is valid”

Sorry, here’s an update graph:

I tested this and it works

1 Like