Description

This behavior is a regression in 4.12. Essentially we switched to attaching child components as part of the OnRegister() logic. This caused all root-level SCS components (including non-scene component types) to register first, followed by child-level SCS components.

See the UDN post for more details.

Note: "Native" non-scene components (i.e. those created in C+) have always been registered before SCS execution. That behavior should remain unchanged for now to be consistent with the previous behavior. However, an additional edge case was found in that a native Actor class with only a non-scene component created in C+ can have a dependency on the root component set by SCS execution - in that case, the native non-scene component registration should be deferred until after SCS execution has set up the root component for the Actor instance. This can be tested as follows (example):

  1. In C++, create a native Actor subclass with a native non-scene component type as its only default subobject (e.g. URotatingMovementComponent).
  2. In the editor, create a new Blueprint class based on the custom Actor subclass created in step 1. Add a StaticMesh component and assign an asset so it's visible.
  3. Add an instance of the Blueprint class to the level, and use PIE to verify that the SMC does indeed rotate at runtime.
Steps to Reproduce
  1. Open UE4.sln in Visual Studio. Build and run a 'Debug Editor' configuration for the QAGame project.
  2. Start debugging to launch QAGame editor w/ Visual Studio attached.
  3. Create an Actor-based BP.
  4. Add scene components such that there is at least one child.
  5. Add a non-scene component type (e.g. RotatingMovement)
  6. In the Visual Studio IDE, put a breakpoint in UActorComponent::RegisterComponent().
  7. Back in UE4, compile the blueprint. Examine the 'this' pointer each time the breakpoint is hit to see which component is being registered.
  8. Note that the SCS child scene components are registered AFTER the non-scene SCS component.

Expected result: SCS scene component instances (including children) are registered BEFORE non-scene SCS component instances.

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - Gameplay - Components
Affects Versions4.12
Target Fix4.14
Fix Commit3131318
Main Commit3152997
Release Commit3159180
CreatedSep 7, 2016
ResolvedSep 19, 2016
UpdatedFeb 4, 2019