Answer
Live Coding cannot apply header changes that alter a UClass or UObject memory layout; these modifications require a manual editor restart to take effect. Hot Reload does not provide better stability for structural changes—in modern versions of Unreal Engine, it is deprecated and carries a higher risk of memory corruption and editor crashes than Live Coding. For iterative development, use Live Coding for function-body updates and perform a full restart for any structural layout changes.
Confirmed Facts
- Live Coding Limitations: It cannot safely patch in-memory objects when the class layout changes. Supported updates are limited to function body changes within an existing layout.
- Restart-Required Modifications: The following header changes will fail to resolve via Live Coding:
- Adding or removing
UPROPERTY members.
- Changing member types, order, or alignment.
- Modifying the inheritance hierarchy.
- Adding, removing, or changing the signature of virtual functions.
- Changing the underlying type or size of an enum.
- Hot Reload Status: Hot Reload is deprecated in modern Unreal Engine. It is prone to stale vtables and memory corruption when headers are altered, making it less reliable than Live Coding for structural iteration.
Likely Explanation
Live Coding compiles changed modules in a separate process and patches the running memory. While this preserves the game world state for logic changes, it cannot rebuild the physical layout of objects already allocated in memory. Hot Reload attempts to swap binaries within the editor process itself, which often leaves existing objects pointing to outdated memory layouts, leading to instability.
Recommended Workflow
- Categorize the Change: Determine if the edit is "code-only" (logic inside a function) or "layout-affecting" (changes to members, inheritance, or virtual tables).
- Apply Logic Changes: Use Live Coding for code-only updates.
- Apply Structural Changes: Close the editor, compile via your IDE or build tool, and restart the editor.
- Avoid Hot Reload: Do not rely on Hot Reload for structural iteration in modern engine versions.
Assumption: This behavior is consistent across Unreal Engine 4.x and 5.x, though specific supported change sets may vary by minor version. Note that changes to UPROPERTY specifiers can be layout-affecting even if the C++ member type remains the same.
Missing Diagnostic Detail: To refine this recommendation, please provide the specific Unreal Engine version (e.g., 5.3) and confirm if both Live Coding and Hot Reload are currently enabled in your project settings.