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

**URL:** <https://forums.unrealengine.com/t/root-component-is-getting-flattened-at-runtime-children-is-side-by-side-with-the-root-why/789589>\
**Category:** Blueprint\
**Tags:** root-component, unreal-engine, Blueprint, question\
**Created:** [March 13, 2023, 9:46am UTC](https://forums.unrealengine.com/t/root-component-is-getting-flattened-at-runtime-children-is-side-by-side-with-the-root-why/789589 "2023-03-13T09:46:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlfredBaudisch](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alfredbaudisch/32/556329_2.png) [@AlfredBaudisch](https://forums.unrealengine.com/u/AlfredBaudisch)\
**Post date:** [March 13, 2023, 9:46am UTC](https://forums.unrealengine.com/t/root-component-is-getting-flattened-at-runtime-children-is-side-by-side-with-the-root-why/789589/1 "2023-03-13T09:46:27Z")

</div>

## Problem

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

 ![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/9/40930a557859530d7eb287b3b5d902f3a6fc0693.png)

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

 ![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/d/bed48fdc93bfd398f3c0a26c33da8ff1c73d9a74.png)

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.

---

<div class="post-metadata">

**Author:** ![AlfredBaudisch](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alfredbaudisch/32/556329_2.png) [@AlfredBaudisch](https://forums.unrealengine.com/u/AlfredBaudisch)\
**Post date:** [March 13, 2023, 11:54am UTC](https://forums.unrealengine.com/t/root-component-is-getting-flattened-at-runtime-children-is-side-by-side-with-the-root-why/789589/2 "2023-03-13T11:54:25Z")

</div>

## 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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/e/53e6ee76198ef4228e6b30e5f7750bc33f454949.png)

![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/a/b5adb6aa618db77b698267b618119087796b956d.png)

Runtime:

 ![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/6/e/e6e9c1ae9826fcb00a3d2e8cbe2d9c39dcac8818.png)

Without Simulate Physics it works.

😢

## UPDATE 2

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

![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/0/fb0ae916f17ea60d575d21e922437e023db92427.png)

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/c/69c5659ff1129bbba60aedc5d6042a69a768082e.png)

---

<div class="post-metadata">

**Author:** ![AlfredBaudisch](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alfredbaudisch/32/556329_2.png) [@AlfredBaudisch](https://forums.unrealengine.com/u/AlfredBaudisch)\
**Post date:** [March 13, 2023, 12:07pm UTC](https://forums.unrealengine.com/t/root-component-is-getting-flattened-at-runtime-children-is-side-by-side-with-the-root-why/789589/3 "2023-03-13T12:07:43Z")

</div>

## 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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/5/5d5650ba7c704481c9248da21c8fbc6ef3f6ef51.png)

Did I find an engine bug?

I.e. if hierarchy is `Scene Component` → `Capsule Collider (Simulate Physics: ON)` → `Static Mesh` then this happens.

---

<div class="post-metadata">

**Author:** ![AlfredBaudisch](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alfredbaudisch/32/556329_2.png) [@AlfredBaudisch](https://forums.unrealengine.com/u/AlfredBaudisch)\
**Post date:** [March 14, 2023, 7:43am UTC](https://forums.unrealengine.com/t/root-component-is-getting-flattened-at-runtime-children-is-side-by-side-with-the-root-why/789589/4 "2023-03-14T07:43:09Z")

</div>

## 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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/6/716b66dd63decbd9d7616aa6febe3a78cfe94879.png)

_(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](https://danny-padron09.medium.com/using-the-physics-handle-to-grab-objects-in-unreal-70ec9e5382f4)).

 ![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/c/07c11be02ae86119edcc251431cf9ca9f731d148.png)

---

<div class="post-metadata">

**Author:** ![AlfredBaudisch](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alfredbaudisch/32/556329_2.png) [@AlfredBaudisch](https://forums.unrealengine.com/u/AlfredBaudisch)\
**Post date:** [March 14, 2023, 9:06am UTC](https://forums.unrealengine.com/t/root-component-is-getting-flattened-at-runtime-children-is-side-by-side-with-the-root-why/789589/5 "2023-03-14T09:06:07Z")

</div>

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:

> [@Attach/detach Actor with SimulatePhysics to skeletal mesh](https://forums.unrealengine.com/t/attach-detach-actor-with-simulatephysics-to-skeletal-mesh/356862):
>
> Hi all, I’m having trouble with something that seems like it should be should be simple, but just isn’t working. What I’m trying to do is have a weapon laying on the ground that has SimulatePhysics enabled - so it can be kicked, shot at, pushed around, etc., that I can pick up and use. When I use it (handled by a different BP+Interface), it should attach to my player model (with SimulatePhysics disabled) so I can fire it. When I drop it, I want it to go back to the state of being a prop - so I…
