SeniorDebuggingRareNot answered yet
How do you rename or retype a UPROPERTY without breaking already-saved assets?
Designers tuned Health on hundreds of saved weapon assets. A code rename to MaxHealth compiles fine, but every saved asset now loads with MaxHealth = 100 (the default) — the designers' tuned values are silently gone.
// Before — values were authored against this name:
UPROPERTY(EditAnywhere)
float Health = 100.f;
// After — renamed in code, nothing else changed:
UPROPERTY(EditAnywhere)
float MaxHealth = 100.f;
Find and fix the bug.
Saved assets store property values keyed by reflected name, so a plain rename silently drops the old value. Add a CoreRedirects entry in DefaultEngine.ini mapping old name to new so the loader rebinds it. A type change is not redirectable: implement Serialize or PostLoad with a custom version (FCustomVersion) to read the old layout and convert it.
- ✗Renaming a
UPROPERTYin code and assuming saved values follow the new name - ✗Believing
CoreRedirectscan also handle a type change, not just a rename - ✗Forgetting to bump a custom version, so old and new data cannot be told apart on load
- →Where do you register an
FCustomVersionand how doesPostLoadread it? - →How do property redirects differ from class and enum redirects?