Is it possible to actually change information inside of a structs?
Here I am attempting to change the ‘life points’ variable within a struct but in doing so I only seem to be able to change it within a local variable.
Yes, you can change values of structs. It’s just data.
Not sure I get the evidence. You’re updating one struct but printing another… Each actor instance has its own data. Changing a struct belonging to one actor will not make it propagate to another instance.
I only seem to be able to change it within a local variable.
Why are you calling it a local variable, it’s not local. We’re in the main graph.
Sorry I musn’t have been clear, or maybe I’m doing something silly, but both variable are the using the same struct. Each screenshot is from a different blueprint. I was intending to change the information in the structure so that the other blueprints could fetch it from the struct too. It seems local in that if I change it in the first bp then it stays consistantly changed there but not elsewhere when I try to get it.
I only named them different because they are in different bps, they are both using the same struct.
If I now go to the Game Mode and create another string there, it will be just an empty string unless I punch in some text or grab one of the actosr and get its unique text. Structs are no different - they are collections of basic variables.
It seems I have incorrectly conceptualised structs, I was thinking of the struct as though it were a definitive place to change information within as opposed to being just a variable
It’s just a fancy variable that is difficult to work with and makes the editor crash more than usual. Indispensable, though.
Were you expecting them to behave like they do in C++? You could declare a struct in a framework class and have other actors access it but BPs copy a lot of data, one needs to mindful of that.
I see I see, thank you for straightening that out for me, and for the warning. I haven’t used C++ before no, but I’m flattered in some sense that the line of thinking would lead to that connection.
Also just to say, I see you all over the forums here whenever I look stuff up and you’re great help, keep up the great work.