Scene component hierarchy design

Hi, I have the following question.

To make collision detection work correctly, you must attach some ShapeComponent (Sphere, Capsule etc.) as the RootComponent.
Then you attach the mesh as a child of the root ShapeComponent.

The order may be vice versa (mesh is the root component and the shape component is the child of the root mesh component)
and helper SceneComponent (USceneComponent) may be attached in-between the mesh and the shape component
(meaning, USceneComponent is a child to root shape component, and a parent to the mesh).
The important thing is that it’s WRONG to add the SceneComponent as the root component and attach both mesh and shape as the child of the root scene component
as the collision detection will not work as indended in that case.

THE GOAL is to make component hierarchy that satisfies the following rules:

  1. Make transforms of MeshComponent and ShapeComponent to be independent of one another
    So, when you scale or rotate, or move the parent ShapeComponent, the attached mesh is NOT transformed.
  2. Both components are to be transformed relative to the actor (i.e. to behave like they’re normally attached to the actor).
    So, when actor is rotated, both the shape component and the mesh are rotated as well etc.
    The QUESTION is how design component hierarchy to achive this goal and whether all I described here is correct?

There’s NO goal, that shape component and mesh component are moved dynamically relative to actor or relative to one another,
the question is just about initialization of their transforms.

I could do the following:

  1. I could **add the SceneComponent as the root **and attach both Mesh and Shape components to the root scene component
    but it’s wrong - collisiong detection will not work (see above)
  2. I could set the Location/Rotation/Scale to World Mode inside the Transform’s section of the mesh component attached to the root shape component,
    (or call **USceneComponent::SetAbsolute(bNewAbsoluteLocation, bNewAbsoluteRotation, bNewAbsoluteScale) **in C++/Blueprint).
    However, that mesh will not be transformed relative to Actor in that case.
  3. I could use combination of **USceneComponent::SetAbsolute **and updating transforms of all components so that they relative to actor inside the **Tick **function.
    Not a solution, really.

It would seem to be editing-only issue. It is when both the mesh and the shape component are attached inside the same blueprint,
so when the shape component is transformed, the transform of the attached mesh is corrected right that time using the tranform tool in world space
(ctrl + ` shortcut inside blueprint’s viewport editor to change world/local) inside the same blueprint
(but ever in that case, it seems that another solution should exist).
**However, the real situtation **is that the parent shape component is attached
**inside **the **parent C++ class **and transform of the parent shape component is controlled from that parent C++ class,
and the **child mesh is attached inside the blueprint **inherited from that parent C++ class. So, when I set the scale of the parent shape component
inside the base C++ class, scale of the child mesh silently changes inside the inherited blueprint (it’s good when only single blueprint is inherited, but it’s not always the case).

See picture below - before the parent capsule component is rotated.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_174762_1571216693523_547”,“title”:“ComponentHierarchy_Initial.png”}[/ATTACH]

See the next picture below - after the parent capsule component is rotated, the mesh is rotated as well (the goal is that it should NOT be).
Note that capsule component rotation could be initialized inside C++ code, and that initialization C++ code could be modified later.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_174764_1571217057589_886”,“title”:“ComponentHierarchy_ShapeRotated.png”}[/ATTACH]
https://forums.unrealengine.com/core/image/gif;base64

It seems to be one of the first questions one should encounter when using UE4, however I can’t find an answer. Maybe I just use wrong appproach
and do not get something very basic about designing component hierarchies. I would appreciate your help, thanks in advance for any response.
Sorry for my possibly-bad english - I’m not a native english-speaker.

UPDATED: Now I know that when you update some component’s property default value in C++ class, the previous value still holds in the blueprints inherited from that C++ class. Looks like it’s really editing-only issue. However, it’s still interesting whether it’s possible to organize the hierarchy in such a way that the capsule and the mesh are transform-independent from each other but attached to the actor and normally affected by the actor’s transform.

I don’t think this is right, because even some documentation states you can add USceneComponent as the default: C++ Only | Unreal Engine Documentation and also if you create a blueprint from the editor, the USceneComponent is the root component. But i hear you, because i’m having weird issues too?

You should be able to use SceneComponent as a root and have valid collisions.

For example:
SceneComponent (Root)
| - MeshComponent
| - ShapeComponent

I have used this structure without any issues in my projects. Maybe you’re experiencing a bug?