Clear Array node not responding to flow control

Hi everyone,

I think there must some concept I don´t understand but I´m trying to clear an array when a boolean variable is false, but the Clear node runs every single frame. It seems that it ignores the branch node that´s preceeding it.

I´m posting two images to clarify the situation. In the first image, the Clear node runs every frame no matter what value the boolean variable is.


In this second image, if I link a Print String node, it works perfectly.

Is there something special about array nodes and flow control? I substituted branch node with while and for loops but it didn´t work either

Thanks a lot in advanced

Unless this some new bug then this is impossible.

You are looking at the wrong part of the blueprint… are you sure the boolean condition is not always false?, what’s the condition?, are you sure the array get’s cleared every frame? are you sure something else doesn’t clear the array? it could be anything at this point :stuck_out_tongue:

Thanks for your answer, but I´m totally sure that the boolean is not always false. It works with any node except those that apply changes to the array. It´s frustating.

Okay but without knowing what is going on in the rest of the blueprint I have no idea what to think… maybe the condition is always false if you clear the array for example… like I said, it could be anything.

When I recreate the graph that you are showing (a branch with any boolean with any string array) then I cannot replicate your problem… cause the problem is obviously not there :stuck_out_tongue:

You were right. The problem is not there. My blueprint inserts an element in the array every frame. The boolean value comes from checking if the last element inserted in the array is the same as the preceeding one, so as soon as the Clear node clears the array, the boolean is always false since there´s only one element in the array.

Thanks a lot.

Solved. I´ve used a Branch node so it doesn´t check when the preceeding element index is -1, because obviously, it doesn´t exist.