# When I add a child component it only adds it to the root Component. How do I child it to a different parent than the root

**URL:** <https://forums.unrealengine.com/t/when-i-add-a-child-component-it-only-adds-it-to-the-root-component-how-do-i-child-it-to-a-different-parent-than-the-root/475522>\
**Category:** C++\
**Tags:** add-variable, add-component, unreal-engine, question\
**Created:** [December 7, 2020, 12:05am UTC](https://forums.unrealengine.com/t/when-i-add-a-child-component-it-only-adds-it-to-the-root-component-how-do-i-child-it-to-a-different-parent-than-the-root/475522 "2020-12-07T00:05:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrozenDungeon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FrozenDungeon](https://forums.unrealengine.com/u/FrozenDungeon)\
**Post date:** [December 7, 2020, 12:05am UTC](https://forums.unrealengine.com/t/when-i-add-a-child-component-it-only-adds-it-to-the-root-component-how-do-i-child-it-to-a-different-parent-than-the-root/475522/1 "2020-12-07T00:05:10Z")

</div>

When I add a child component it only adds it to the root Component. How do I child it to a different parent than the root.

---

<div class="post-metadata">

**Author:** ![Alekann01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alekann01](https://forums.unrealengine.com/u/Alekann01)\
**Post date:** [December 7, 2020, 12:25am UTC](https://forums.unrealengine.com/t/when-i-add-a-child-component-it-only-adds-it-to-the-root-component-how-do-i-child-it-to-a-different-parent-than-the-root/475522/2 "2020-12-07T00:25:16Z")

</div>

Hi FrozenDungeon

Use the AttachToComponent node using the reference returned from the spawned component.

Good luck

Alex

---

<div class="post-metadata">

**Author:** ![FrozenDungeon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FrozenDungeon](https://forums.unrealengine.com/u/FrozenDungeon)\
**Post date:** [December 7, 2020, 5:30pm UTC](https://forums.unrealengine.com/t/when-i-add-a-child-component-it-only-adds-it-to-the-root-component-how-do-i-child-it-to-a-different-parent-than-the-root/475522/3 "2020-12-07T17:30:11Z")

</div>

Yes it was AttachComponentToComponent thank you very much.

---

<div class="post-metadata">

**Author:** ![Alekann01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alekann01](https://forums.unrealengine.com/u/Alekann01)\
**Post date:** [December 7, 2020, 6:00pm UTC](https://forums.unrealengine.com/t/when-i-add-a-child-component-it-only-adds-it-to-the-root-component-how-do-i-child-it-to-a-different-parent-than-the-root/475522/4 "2020-12-07T18:00:26Z")

</div>

Hi FrozenDungeon.

Glad you got it sorted. Could you mark the question as answered please.

Good luck with the rest of your project!
