class default value after c++ class compile will temporary initialized. It will be restored when opening the project again.
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.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-52606 in the post.
9 |
Component | UE - Foundation - Cpp Tools - Hot Reload |
---|---|
Affects Versions | 4.18.1 |
Created | Nov 21, 2017 |
---|---|
Resolved | Aug 18, 2021 |
Updated | Aug 18, 2021 |