This is a regression that was introduced with changes made to address issues with native vs. non-native component registration at Blueprint construction time (
Prior to those changes, unregistered scene components were "accidentally" being registered during Blueprint Actor instance reconstruction as part of a "catch-all" loop. That loop has been removed as part of the refactor, so that fallback is no longer in place.
The suggested workaround is to explicitly register nested scene component subobjects inside of an OnRegister() method override, implemented on the owning component's native C++ class.
1. Launch the editor and create a new (blank) C++ project.
2. Add a new C++ class based on SceneComponent (call it MySceneComp).
3. Add a new C++ class based on SceneComponent (call it MyNestedSceneComp).
4. Modify MySceneComp.h to include the following in the class decl:
5. Modify MySceneComp.cpp to include the following:
6. Modify MyNestedSceneComp.h to include the following in the class decl:
7. Modify MyNestedSceneComp.cpp to include the following:
8. Recompile the project in Visual Studio and wait for the UE4 editor to hot-reload the updated class.
9. Back in the UE4 editor, create a new Blueprint class based on Actor.
10. Drag an instance of the new Blueprint class into the scene and select it.
11. In the Details view, click the "Add Component" drop-down and choose "MyNestedSceneComp."
12. Open the output log window. The message "MyNestedSceneComp - OnRegister" should be visible.
13. Back in the Details view, click the "Add Component" drop-down again and choose "MySceneComp"
14. The message "MySceneComp - OnRegister" should be visible. However, the message "MyNestedSceneComp - OnRegister" is not visible, which indicates that the nested MyNestedSceneComp subobject did not get registered along with it.
Expected result: The nested subobject (MyNestedSceneComp in this case) should have been registered along with the outer component (MySceneComp in this case). Both log messages should be printed out as a result.
There's no existing public thread on this issue, so head over toAnswerHub just mention UE-38690 in the post.