Looked up some info on this subject as I’m very new to Unreal so just wanted some clarification on this behaviour as it seems a bit diferent to what you were describing.
I am using Unreal 5.0.3 and from what I have experienced the behaviour for live coding seems to work like this.
Adding the variable code to the source file for the Actor object will appear in the unreal project after the Live code button is used to compile.
If the project is then closed and reopened the variables are lost and to get them back I need to click the liveCode button again and the variables re appear. Also note that saving the unreal project makes no diference.
To make the variables permanent in the unreal project, I need to perform a full compile of the Actor Source code from the IDE (with the editor closed).
Then open the project in the unreal editor and I can see the variables, if I then change the values of the variables and save the project then reopen the values remain changed.
It seems the Live code is acting like a temporary solution to allow for testing but to commit permanent changes to the unreal project the source code needs to be recompiled from the IDE
Does this seem right, or is something not working as intended?