Summary
Undo of an edit to a placed Blueprint actor that has a PCG component brings the actor back with the PCG component’s graph parameter overrides gone. Renaming or deleting the actor followed by Ctrl+Z both do it. A graph parameter set on the placed instance is empty after the undo, and the component’s graph instance is left marked as garbage.
What Type of Bug are you experiencing?
World Creation Tools
Steps to Reproduce
- Create a PCG graph with one graph parameter, for example a Soft Object Path named Kit. Leave its default empty.
- Create a Blueprint with parent class Actor. Add a PCG component and set its Graph to that graph. Compile.
- Place the Blueprint in a level. On the placed actor’s PCG component, override the parameter by setting Kit to any asset.
- Rename the actor, or delete it.
- Press Ctrl+Z.
- Inspect the parameter on the placed actor’s PCG component.
Expected Result
The parameter keeps the value set on the placed actor, as it had before the edit.
Observed Result
The parameter is empty (the graph’s default). The PCG component’s graph instance is marked garbage (IsValid() returns false). Undoing an edit of the parameter itself restores it correctly. The problem only appears when undo rebuilds the actor’s components.
Affects Versions
5.8
Platform(s)
Mac
Additional Notes
Cause, as far as we traced it:
- RerunConstructionScripts on undo applies the actor’s transaction annotation. That is a FComponentInstanceDataCache captured when the actor is first modified in the transaction.
- The cache saves the instanced GraphInstance as a DuplicateObject, and that duplicate is made inside the still-open transaction.
- DuplicateObject runs PostLoad on the copy. UPCGGraphInstance::PostLoad calls RefreshParameters, which calls Modify(), so the transaction records the copy as an object it created.
- On undo the transaction reverts the copy, emptying its ParametersOverrides, and marks it garbage. Then PostEditUndo triggers RerunConstructionScripts, which hands that copy to the rebuilt component.
- Isolated in an automation test: a UPCGGraphInstance duplicated inside an FScopedTransaction and then undone comes back with the parameter empty and RF_MirroredGarbage set. The same duplicate made outside a transaction keeps its value.
- Our workaround: carry the overrides by value in another component’s FActorComponentInstanceData, and restore them in the actor’s OnConstruction.
Engine 5.8.4 (CL 58902052, launcher build), macOS 27.0.1, Apple Silicon. Not tested on Windows.