Hi !
I seem to have a serialization issue with USTRUCTs.
Every time i add/remove a variable (or just change the type of one), the value of all the variables on the structure are reset, everywhere in my project.
I thought this was the correct way of defining structures, but it seems to not be the case.
Question : how can I properly define a structure in code that doesnt break ?
Struct Example:
USTRUCT(BlueprintType)
struct FInteractableConfig : public FTableRowBase
{
GENERATED_USTRUCT_BODY();
public:
FInteractableConfig() {
HoldMethod = EHoldMethod::ClickOnce;
SnapMethod = EGrabSnap::Free;
}
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
EHoldMethod HoldMethod;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
EGrabSnap SnapMethod;
};
If I add a new variable to it (for example bool Whatever). Compile, close/reopen the project (unreal4 wont show me the modifications until then), then HoldMethod and SnapMethod would be reset to their default.
If I delete the newly added variable, the same happens.
I’ve had this issue for quite some while (4.17… ?) and skipped doing anything half serius with UE4 because of it. 1-2 years after, I come to think I may be doing something wrong in the definition of my structure.
Thanks !