Is it possible to create a component that has 2 sub-components in native code using the constructor? My current scenario is I have a child of UMotionControllerComponent that pre-creates 2 subcomponents in it’s constructor using CreateDefaultSuboject (a USkeletalMeshComponent and a USphereComponent). Both of the subcomponents are attached to the their owner (the UMotionControllerComponent).
The problem I’m running in to is when I add my UMotionControllerComponent’s to my Character’s sub-components in it’s constructor using CreateDefaultSubobject neither of the two sub-components are editable in the editor. And if I add a second of my UMotionControllerComponent, the object hierarchy breaks altogether. Maybe because the 2 auto-created sub components share the same name so the hierarchy stacks them under the first UMotionControllerComponent. It’s worse if I try to add the via the add component button in the editor…
I’m guessing that I’m just breaking the paradigm for using components here. I can solve this in order ways but this seems like a case that should work. Am I just missing something?