Description

Reparenting a blueprint from a blueprint to a native class will cause data loss if both parents have a component with the same name. The component ptr will always be null after reparenting. Expected result: reparenting maps component data from original parent to new parent. 

Steps to Reproduce
  1. Create an actor blueprint named "BP_Parent"
  2. Add a Box component named "Box" to BP_Parent
  3. Compile and save BP_Parent
  4. Create a child blueprint deriving from BP_Parent named "BP_Child"
  5. Compile and save BP_Child
  6. Create a native class derived from AActor named "ANativeParent"
  7. Add a UBoxComponent* variable named "Box". Mark up as a UPROPERTY
  8. In ANativeParent's constructor, create a UBoxComponent using CreateDefaultSubobject and point the Box pointer at it. Box = CreateDefaultSubobject<UBoxComponent>(TEXT("Box"));
  9. Save and compile the project
  10. Reparent BP_Child from BP_Parent to NativeParent
  11. Compile BP_Child and check the Box variable after BeginPlay and Box will be a nullptr. 

Have Comments or More Details?

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

11
Login to Vote

Won't Fix
CreatedJun 18, 2019
ResolvedAug 27, 2021
UpdatedAug 27, 2021