Root Component is getting flattened at runtime, children is side by side with the root, why?

Problem

I have the following component hierarchy that I manually dragged and dropped and created:

imagen

But at runtime it gets flattened for some reason, messing up interactions:

imagen

There’s nothing in the Blueprint other than these components, so there’s not much else for me to share to help the issue, it’s a plain Blueprint.

Except for a few settings:

  • StaticMesh 01 to 03 are set to not visible.
  • Capsule has custom physics settings.

Question

Why is it getting flattened? I even revised the Actor by diffing in the repository since its creation, and I can’t see that I have changed any other setting.

The project was migrated from UE4, so what I did was cloning it from the Git repository again to see whether it could be a caching issue, but the issue is really there.

1 Like

UPDATE 1

Creating the blueprint from scratch, but now with a single mesh also flattens the hierarchy (there are no functions, nothing in the Event graph from me that could be doing this). The only change I made was activating Physics.

imagen

imagen

Runtime:
imagen

Without Simulate Physics it works.

:cry:

UPDATE 2

When removing the scene root SceneComponent and making the Capsule Collider the root the hierarchy is not flattened.

imagen

But it doesn’t solve it for me, because I need to keep the hierarchy of Scene Component → Capsule Collider → Meshes.

But why is this happening ONLY HERE and it never happens everywhere else?

For example, this other Actor is fine and doesn’t get flattened.

imagen

UPDATE 3

Since the hierarchy gets flattened, if I attach the actor to another actor, only one of the components get attached, the rest stays floating in their current location in the world.

imagen

Did I find an engine bug?

I.e. if hierarchy is Scene ComponentCapsule Collider (Simulate Physics: ON)Static Mesh then this happens.

UPDATE 4

I still haven’t figured out why the flattening happens, and why for other Actors it doesn’t, like, the Character is never flattened at runtime:

imagen

(Is this topic turning into a devlog?)

But…:

Attaching and moving physics actors

In all of this, at least one big lesson so far. To attach physics actors/components to move them around, you must use a Physics Handle and attach to it (source).

imagen

Seems to be by design, so I’m considering this as solved.

The gotcha is that when you set simulate physics on a component, it detaches that component from its parent.

Make sure the StaticMesh is the Root of the Actor you’re trying to attach, that fixed it for me.

Source: