Can't make "Set members in struct" node work

Your logic is absolutely sound. It’s the way blueprints handle structs and copy data all the time; it’s a frustrating experience, especially when one starts nesting structs inside other structs.

In, short: functions will not return structs by reference. They will create a copy of the data. If you then make changes to that data, you’ve made changes to the copy, not the original struct you intended.

When you change the data inside this function, you have, indeed, modified the original player’s data. Outside the function, you modify the data the return pin copied - that data is not the player’s data anymore.


One way to handle what you originally envisioned, is to push the data back in. The function returns the Player Reference (actors, luckily, are always by-ref), so after modifying the copy, set the player’s struct again. Since you’ve exposed only a single struct element, the rest will remain unchanged and behave.