Changing items in array of struct

The goal is to call the “attribute array”, which is an array of “Master attribute” structs and change a certain value in an index chosen by the “Target for Item” than to plug the change into the array. In this case to change the “SP” value in the “Master Attribute” struct without changing the other values.

I run the blueprint and the array does not change it’s “SP” value. I’m pretty sure the problem starts with the “set members in Master attribute” giving an undesired output.

How do I get this to work?

http://puu.sh/oqLxD.png

Basically Structs in blueprints don’t work well. You have to use either workarounds or C++. Especially when using them in arrays! It’s an old bug going back as old as UE4.4 (also exists in 4.11).

Another workaround would be to create a blueprint and fill it with global variables and use that instead of a struct. Now you always have pass-by-reference and you won’t run into this bug.

Without resorting to C++ you have to apply some sort of hack. But over time I learned that when using blueprint-projects, you have to hack a lot because a lot of functionality is bugged/missing for blueprints (pawnsensing, structs, takedamage-override, painvolumes, no editor-only-nodes, etc.) so we might as well get used to it ;).

I’ve just published article regarding this elaborating about my findings: Array of structs or actors in blueprints? | by Daniel K. | Medium