Set members in struct not working

I’m trying to change the value of a member from a struct I have created that contains the teams’ information, but it is not updating when I set it in “Set members in Struct”.

These pics can explain way better:

SetMembers4.jpg

As you can see, it prints the display name correctly from the parameter I’ve passed on, but the same is set in one of the members through Set Members in STeamInfo and prints NULL…

I have already checked if the array’s length is valid.

Any ideas? Must solve this ASAP :slight_smile:

The node is working as it should. The problem you are having is that the array ‘Get’ does not return a value by reference, so you are essentially setting no variable when using Set Members.

2 Likes

Thanks for the reply.

So, following this I have put, manually, some index values inside the Get and printed the “Color” values inside the respective index.

As I set before, the default color values at each index are:
0 - Green
1 - Black

It is printing correctly each value at the given index, leaving me to think that the ‘Get’ is working but the Set members in Struct is not…
Avoiding the “Get” node, I have made the following logic, that left me with the same results.

0dad158eda8733167975d8b363c0df81a9ad2dd0.jpeg

I might be creating a little confusion about this episode, but I’m pretty sure the Set members is not working as it should.

I’m currently using the 4.11.

OBS:
All this logic is being made inside the GameState child class. Just saying… could be useful :confused:

Well, as I was saying before, the Get node does not return a value by reference, nor does the ArrayElement pin on ForEachLoop. SetMembers is setting nothing but a plain value, and it outputting the value that it was unable to set.

1 Like

Got it now, thanks for the help, I made it work this way:

7212a54094e0bc066f8390ace8122235ad2d589e.jpeg

It would be better if we could set individual values inside an struct, as suggesting the Set members in struct, but not only by ref.

1 Like