Description

Calling RegisterComponent in the PreInitializeComponents of an Actor will cause child components of its components to be ignored because the Actor is still being initialized. My understanding is that the component list for the Actor is gathered before these components are added and therefore they are missed.

Regression?: No
This also occurred in 4.17

Steps to Reproduce
  1. Download the attached project, generate project files, compile, and open the project
  2. Press Play and check the output log
  3. Note that there are multiple messages mentioning that multiple components have been initialized
  4. Open the project's .sln file in Visual Studio
  5. In NcTestActor.cpp, replace "BEGIN_PLAY" on line 8 with "CONSTRUCTOR"
  6. Compile
  7. In the project, press Play again
    Result: Only one component is initialized, the one that the Actor directly references
    Expected: The same amount of components are initialized as in the previous test

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-53543 in the post.

1
Login to Vote

Backlogged
ComponentGameplay
Affects Versions4.174.184.19
CreatedDec 15, 2017
UpdatedFeb 1, 2019