Having AI go to activated Actor location

So I am new to this and I’m probably going about this all wrong but here my problem.

I have an AI that is suppose to go to an actors location (its sort of a flare the player throws to distract the AI) once the actors blueprint is activated. I have it working but it seems once more then one of the actor is placed one the map only one of the actors will active the AI.

For the life of me I cannot figure why its happening.

Heres a pic of the AI Blueprint

That’s sounds perfect. I’m not sure how to go about finding the locations of all actors in my array though?

Your issue is with GetAllActorsOfClass->Get(0). GetAllActorsOfClass returns a list of all the actors of that type, but by using Get(0) you are always selecting the first one it finds. You will need to implement a smarter way to select the correct actor. You will need to find the one you need by going through that list and checking for whatever conditions you are looking for or by passing in a reference to which actor to go to.

For an example with the flairs, I would suggest going through the list and finding the flare that is closest to the AI, then have the AI go towards that one and ignore the others.

You can use a For Each Loop and call GetActorLocation on each one as you go through. I would suggest watching/reading some tutorials, as you’ll find plenty examples. Youtube should have some tutorials specifically on this problem.

Also if this helps you, don’t forget to mark it as answered.