How set a vraibale from blackboard with all AI in level?

for example, one ai saw the first player and set Enemy in blackboard, I want its set for all AI in the map, it means all AI aware of enemy .
I will thank full if someone could help.

I did something like this but after that, all of AI act weird .

you just need to have an event which calls the get all actors of class node which will get all the character of the class that you specify (could also be done with tags via get all actors with tag). the get all of class node will output a array which contains all the enemies in the level, you can use this array in conjunction with a for each loop to set the variable you need.

the result should be something like the below image. do note that you may want to add in a bit more functionality so you dont execute this more than once if not needed. for example you wouldnt want one enemy to see the player and notify, then another enemy shows up and does the same thing. so i would add in a a check to see if the key is already set to true before the get all actors of class.

How exactly did your AI ‘act weird’? Perhaps the variable just isn’t working the way you’d expect. Maybe there’s a hole in your logic?

Just glancing at the screenshot you have provided, you are itterating through each actor and setting them as the value of some other target reference, which seems like a strange operation to do. You’d be changing a single value multiple times, very quickly - there’s not a lot of uses for that. Do you mean to switch those two blue lines- have the Target be the Array Element and the reference off to the left be the Object Value?

Hi, thanks for your replay, your explanation create another question for me, im mostly c++ user and new to BP, can you explain to me how I can create an event with a connection to a boolean? I have variable with boolean and I want to connect it to the event? in simple language when my boolean is true event work.
thanks .

im not sure exactly what your trying to say. are you trying to add a parameter to the event, fire the event when the bool is true, or only allow the event to function when the bool is true?

for adding a parameter you just select the event node then in the details panel you should be able to add parameters,

if your looking to only allow the event to happen when the bool is true then you just need to a branch just after the event then connect you bool value to the branch. this will make it so the script can only run when the bool is true. course theres other flow controls too like gates which could be of help in other circumstances.

hopefully that helps a bit, or maybe i missed the mark there. in any event post again if your still having trouble.