Undo fills AttachChildren array with null by the undo serializer.
After that, a construction script tries to remove child components from parent component's AttachChildren but it can't find its pointer.

To apply NonTransactional option in the UPROPERTY on the AttachChildren fixes this issue.

// USceneComponent
	/** List of child SceneComponents that are attached to us. */
	UPROPERTY(ReplicatedUsing = OnRep_AttachChildren, Transient, NoTransactional/*Added*/)
	TArray<USceneComponent*> AttachChildren;
Steps to Reproduce
  1. Open attached project with UE4.22.
  2. Select the right actor named CPP_Constructor in the level
  3. Set "Num of Meshes" 20 in detail pane.
  4. Undo
  5. See log and find NumAttachedChildren has Incorrect number of element



LogTemp: NumChildren:20 NumStaticMeshes:20
LogEditorTransaction: Undo Edit Num Of Meshes
LogTemp: NumChildren:20 NumStaticMeshes:10



The following screenshot displays the broken array.

[Image Removed]


[Link Removed]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-84403 in the post.

Login to Vote

ComponentUE - Gameplay - Components
Affects Versions4.22
Target Fix5.1
CreatedNov 14, 2019
UpdatedJan 28, 2022