Learning about structs

Hi, i’m really new to UE and i’m doing some tests trying to learn about variable types and structs. I have created a function to change the value of an Enum in a custom struct but it seems not working, when i try to print the value i get the default value everytime. I’ve tryed without the function, working directly in EventGraph, but nothing changes. What i’m doing wrong?

This way you are not changing the member inside the struct, you are taking the column array plain value, adding an item and nothing else.

Try “Make MapStruct”, add this new column item to this new temporary struct and, after this, set it to your current Struct.

In C++, what you have done will have worked. Unfortunately, you are not getting Column by reference, so you are setting the array element for an array that just exists in space, which ultimately does nothing. You will need to set the array element of Map Matrix, but make sure to pass Map Matrix by reference into your function.

Thanks for the help, now it seems to work; there’s a smarter or more efficient way to do this? Moreover, sorry for the dumb question, what’s the difference between “Insert” and “Set Array Element”?

Insert inserts an item at a certain index. If you have an array with an item at index 0, and you insert something into index 0, it will push everything back after and at that index. SetArrayElem assigns the index a new value.