Having multiple ai characters with one controller

hello, I’m having trouble with my Ai characters in unreal (using blueprints)
basically I’m having a lot of issues with having more than one instance of my characters using one controller
so far i was able to have them follow different patrol paths using get all actors of class and casting to the patrol nodes (blueprints with locations for patrols) using the array index from a for each loop, and setting a blackboard key for the node. and that is done in the character blueprint, not the controller and the patrol node blackboard key isn’t synced. so far it works great, but my problem is when trying to get one instance only to search for my player location.
basically i have an on perception update so that when the player is seen a timer by event plays to increment a float which is awareness and having a service in the behavior tree that checks awareness ever .1 seconds and compares it to fixed values to determine what state the character should be in (patrol, search,etc…) by setting an enum. now my problem is if i want one character to search for me, because when one character searches for me all of them do. i set it up so that when awareness is within search range, sets a bool (not instance synced) to true and have a decorator on the search nodes in the tree to check if it has equal values to true. so in theory since its not synced only the character who has the bool set true should search. i had the awareness being updated from the controller, so instead i made a tick timeline in the controller blueprint and cast to the character and set a float there with the awareness value, then set a blackboard key float using the float in the character blueprint. still the same issue. i’m at my wits’ and so i can use all the help i can get.
if you want pictures just ask, i’m too lazy at the time of writing to take a dozen screenshots. XP

Hello! I think you have to show something , seems like we are lazy too :stuck_out_tongue:

Sorry for not replying, i ended up deleting my blueprints and starting over again. A better question would be how do i get the individual instance of the aicontroller and cast to that because i think the problem was i was casting to the controller from the character blueprint and it ended up in all the character instances sharing the same variables. So how can i get each character instance to cast to it’s
Instance of the controller and edit its variables? And thanks in advance.

Hopefully, we get a reply soon. I was wondering what was causing my issue and I think you nailed it. all of my AI are sharing a perception controller so when one sees me, they all do.

I may have figured it out but i havent fully fleshed it out yet.
From your event that casts to the controller in the character blueprint, drag a get all actors of class for the controller and run it in a for each loop. The exec is a branch with the condition being an equal for objects. The first object is the array element and for the second object, get a reference to self, drag from it a getaicontroller and plug it into the second object. If its true, cast to the controller with the object node being the array element. That way it should go through all controller instances and only cast to the instance that is controlling the character. And then do what you intend to do with the controller.
I’ve been way to demotivized to touch ue4 lately so if you can see if it works that would be wonderful.
Also if you can, tell me if it impacts the performance. A for each loop with alot of elemwnts and then a cast seem expensive to me, but i hope it doesnt slow down the game too much.