Is it safe to change the order of variables in structs? I would like to re-arrange some in my structs but I am not sure if that might break things in existing blueprints.
I am pretty sure I have done this without issue.
Changing the order shouldn’t matter, but there is a bug that can result in log warnings if you change names of variables in structs that are used in other blueprints.
The best thing to do is to test.
Close your editor and, if you don’t use source control, make a copy of your project folder.
Open your project and check the output log for any warnings or errors to establish a baseline. Run your demo level where the structs are used.
Make your changes to the structs, save all, and close your project.
Open it up again and check output log for any new warnings or errors and run your demo level again.
If no new warnings/errors and everything looks good in your demo level, you are all set. If not, close out and replace project folder with copied project folder.
I would not underestimate the importance of this bit. I kept working after fiddling with a struct referenced in multiple blueprints only to find out I can no longer open the project a couple of hours later.
I’ve seen no problems with reordering but I learnt not to trust structs when applying more tangible changes.
You guys forgetting the “Refresh Blueprint Nodes” option in the blueprint. This fixes my all struct problems whenever I make a big change upon them. Maybe that’s better.
I had some crazy errors after renaming variables or adding new ones to structs. After recompiling some blueprint in a seemingly random order it fixed itself