Get One Boolean From Multiple/Cloned Actors In World/Map

Hello !

To explain more, I did put multiple “Grabber” actors in my map ! I can get the boolean of the actors, but only the first one ! (Index 0 I suppose…)

I can’t make a single boolean from these actors to make my blueprint work !

What I wanted is to have all the booleans, the instance of the boolean, or a single boolean with a reference to my multiple actors !

Cheers !

Voyder R.

It sounds like you want to use Get All Actors of Class to get an array of your Grabber actors. Then use a For Each loop to iterate over that array. Pull off the Array Element pin and you get a reference to the grabbers, then pull off the boolean variable (make sure it’s public in your grabber blueprint).

Once you have the boolean for each element, you can AND them all together to see if any of they are all true, or OR them together to see if any one of them is true.

Thanks for your help ! I did Get All Actors Of Class, and I have follow your instructions ! But I do not understand how to have the boolean for each element !.. (I wanted to check OR Boolean !)

For example, in my map, there is 4 Grabbers Actors (Grabber1, Grabber2, Grabber3, Grabber4) they are all the same, I duplicated them !
How to check if one of them have the boolean set to “True” ? How to have each element, like you said ?

Cordially.

Voyder R.

As you loop over the array, “Array Elements” is your Grabber class. Just drag off the elements tab and look for your boolean variable. If it doesn’t show up, it’s probably not set to public in the Grabber blueprint (it’s the eye icon next to the variable name).

(I just used the “Can be Damaged” boolean in the screenshot because I don’t have your grabber class)

Thank you !!! It worked ! I have one more question and I’m finished : when the player grabbed the other AI, he “throw” the AI ! How to put the boolean to false ? i have tested and when it overlaps, it does not return to false !

Cordially !

Voyder R.

I’m not sure, I’d have to know more about what you’re doing. You can drag a “Set” for the boolean off the array element as well if that helps.

Thank you again ! Sorry for giving you little informations…

You helped me a lot ! And I thank you one more time for your time spend to help me, I appreciate your help coming from you ! :slight_smile: