I’m trying to find out when all items in my Objectives array are complete. I feel like im missing something.
I would create a function.
Function input is Objectives array.
Create Local variable bool bAllObjectivesCompleted and set defaults to true.
For Each Loop with Break using Objectives Array. Branch on the bool same as you did. Off the false set the bAllObjectivesCompleted to false and break the loop.
Return Value off the completed exec returns bAllObjectivesCompleted
Thanks for your reply. I’ve tried what you said, maybe i’ve done it wrong but the Bool always returns true.
You’re setting the variable at the end. You need to use a getter and plug the pin into the return node.
Ensure that local variable defaults to true or set it to true at the beginning of the function or it will not work correctly.
You also shouldn’t be able to access that variable with that picture you have. Is it a local variable only in the scope of the function or did you create a variable in your blueprint class? For the function to take in and return different things you should set necessary class variables outside of the function. Keep the variables inside the function local.

Notice the usability of the function example I have here. These are the above principles applied.
Local variables are found at the very bottom of the My Blueprint window on the left side of your editor (Default)
it seems that it’s only turning true if the Last item in Objectives array is True. it’s not detecting if all are true, only the last one
yes that’s exactly what i have. the bool is never returning true when i print… but i printed the individual array bools and those are printing true. not sure whats going on
is it defaulted true? Like I stated, if it isn’t defaulted or set to true before running the function then it will not check correctly. Also you should never access your variable that is inside the function, that should be local, outside of the function. See how I branch off of the return value? At no point am I trying to reach into the function to get a variable that is set within there, I only use the return value.
I understand it. I’m just confused as to why its not working for me. I’ve print tested everything and this just doesn’t seem to be returning tru
e for me

Is your bool a local variable only present in the function?
yes
try adding the setter node I have before the For Each with Break node.
Also ensure your objectives array actually has all values as true. I know you stated before but this could be why.
Yes you were right. I checked again if the bools were firing true and one of them wasn’t. I got it working now I really appreciate your help!
No worries, glad I could help!
You have an Array of ?
And you want to count, checking for Nulls or totals?
I see you have a looping solution
Sounds like a job for Modulus with Length of array
This has already been resolved. Do you need help?