Download

Boolean check

Hi,
I’m fairly new to this and not very good at programming in general, so bear with me. So I have several actors with bools and I want to check if all of them are true. Now I realize that I could just manually get all of them and check with AND, but I bet there is a more elegant way to do this. I tried using Get All Actors Of Class and I can get all bools while looping through the array but I don’t really know how to check for them like this.
All help is appreciated.

Loop through your actors using a For Each Loop with Break, and if one of your actor’s Booleans is false, set a Boolean variable to True, and then break out of the loop (You already know that one of them is false, so there is no point in continuing the loop). If at the end of the loop, the bool you set is True, you know that one of the actor’s Booleans is false.

Works great, thanks a lot!