Incrementing a local parameter

Hi all,

I’ve created a function that counts the number of elements that are “true” in an array of booleans. It gets executed each frame. Whenever I run the game, I see the following error messages displayed numerous times:

24286-error.png

I thought the problem was that I didn’t set a default value for the local parameter “total”, but then I found out that there isn’t a way to set a default value for it in the editor (unlike non-local parameters). So i tried setting its value to 0 explicitly right before entering the loop using a “set” node, but the problem persisted. The weird thing is, the function seems to be producing correct results. Could anyone please tell me what is wrong here?

Here’s the blueprint of my function: