I stumbled across this strange variable while searching for a way to calculate the sum of an array.
It has one input which is an array, and on the output there is an array plus a single pin which appears to give the sum.
However, this sum pin only outputs zero. I don’t know why, and I couldn’t find any information about this.
Does anyone know the correct way to use this?
Hi, it looks like this struct is from RigVM Plugin. I’ve never used this plugin, but it has it’s own blueprints, so maybe those structs are used there.
I can’t even find those types directly in C++, so I don’t think they can be used in normal BPs.
As for calculating sum of an array I assume you can do it in ForLoop or ForEachLoop. Or you are looking for any special way?
I wanted to avoid loops because I needed to do a lot of calculations to display in the UI.
I thought it was an unfinished feature that was implemented or planned to be implemented based on the appearance of the node. How useful would it be if this variable worked?
But according to your guess, that’s not going to happen…
Sorry, I wasn’t checking forum for a while. Well, it all depends on your situation, but maybe you could create an UObject that would be a wrapper to an array of ints and also has an int as sum of all elements. And whenever you change elements in that object’s array you could trigger recalculate of the sum, so then you need to calculate everything just once.
Edit: In C++ you could do that with struct as well, as structs can have functions in C++. Unfortunately Blueprints don’t support struct’s functions.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.