class default value after c++ class compile will temporary initialized. It will be restored when opening the project again.

Steps to Reproduce

1) Create a c++ actor class(MyActor).
2) Add following code under public: in the newly created actor c++ class.

UPROPERTY(EditAnywhere, category = "test")
int32 EditAnywhereInt;
UPROPERTY(EditDefaultsOnly, category = "test")
int32 EditDefaultsOnlyInt;

3) Compile
4) Create a new Blueprint(MyMyActor) inheriting (MyActor)
5) Open (MyMyActor) in Blueprint editor and change following variables in the class defaults.
EditAnywhereInt = 5
EditDefaultsOnlyInt = 5
6) Save all
7) Go to VS and add following code under public:
int32 testval;
8) Compile c++ class
9) Notice (MyMyActor) have initialized default value as 0 for EditAnywhereInt and EditDefaultsOnlyInt. Expected to have 5 for each.
10) Exit editor and open the project again
11) Open (MyMyActor)
12) Notice default value (5) are restored.

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-52606 in the post.

Login to Vote

ComponentCore - Hot Reload
Affects Versions4.18.1
CreatedNov 21, 2017
UpdatedFeb 1, 2019