Description

Two conditions for this bug to appear:

  1. The new actor class we are re-parenting to overwrites the root component in C++
  2. The map is not loaded while re-parenting

No current workaround other than to reposition the instance after loading.

Steps to Reproduce
  1. Launch UE4 (or UE5) editor with any C++ project.
  2. Add a new C++ class based on AActor (AMyTestActor).
  3. Add the following bit to the ctor code in MyTestActor.cpp:
    ATestActor::ATestActor()
    {
       RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
    }
    
  1. Create an empty Actor-based Blueprint class (MyTestActorBP).
  2. Create an empty level (MyTestLevel).
  3. Drag and drop a MyTestActorBP instance to a random location
  4. Save MyTestLevel. Then unload the map by opening a different level.
  5. Open MyTestActorBP (may need to s.witch to the full blueprint editor first).
  6. Reparent to AMyTestActor (no need to save).
  7. Open MyTestLevel again.
  8. Observe that the instance of MyTestActorBP has moved to (0,0,0).
    Expected result: The instance loads to the position it was last saved at in MyTestLevel.
Callstack

N/A

Have Comments or More Details?

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

1
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions4.27.25.0
Target Fix5.1
Fix Commit20141840
Main Commit20141840
CreatedMay 10, 2022
ResolvedMay 11, 2022
UpdatedOct 6, 2023