# Parent objects in scene

**URL:** <https://forums.unrealengine.com/t/parent-objects-in-scene/298765>\
**Category:** C++\
**Tags:** parent, parenting, unreal-engine, CPP, question\
**Created:** [November 11, 2014, 6:01pm UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765 "2014-11-11T18:01:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![TobiasRusjan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tobiasrusjan/32/1004445_2.png) [@TobiasRusjan](https://forums.unrealengine.com/u/TobiasRusjan)\
**Post date:** [November 11, 2014, 6:01pm UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765/1 "2014-11-11T18:01:49Z")

</div>

Hello. I’m trying to parent an object in the scene (not an actor’s component).

I found Set Folder Path, but I want to have it inside another object, I can do that directly in the Scene Outliner, but I need that from code.

Thank you.

---

<div class="post-metadata">

**Author:** ![TinyTeaTree\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TinyTeaTree\_1](https://forums.unrealengine.com/u/TinyTeaTree_1)\
**Post date:** [November 15, 2014, 6:31am UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765/2 "2014-11-15T06:31:29Z")

</div>

I believe the scene hierarchy might be implemented through the transform. I am noob myself, but if you find the Transform component of an object try looking for a parent in there

---

<div class="post-metadata">

**Author:** ![robbiecooper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@robbiecooper](https://forums.unrealengine.com/u/robbiecooper)\
**Post date:** [November 15, 2014, 12:13pm UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765/3 "2014-11-15T12:13:17Z")

</div>

Hey Tobias

I’m not clear what you mean by “parent”? If you mean you want something to inherit from a class of object, then use “Add Code to Project” in the file menu and choose the class that you want your new object to inherit from. If you mean you want to attach it to an actor then follow something like this;

> **[Attach Actor to socket via C++](https://forums.unrealengine.com/showthread.php?22881-Attach-Actor-to-socket-via-C)**
>
> FVector SocketLocationR; SocketLocationR = Mesh-\>GetSocketLocation("WeaponR"); FVector SocketLocationL; SocketLocationL = Mesh-\>GetSocketLocation("WeaponL"); FActorSpawnParameters SpawnInfo; FVector SocketLocation; const FRotator...

Or this;

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/5/3e59de5ad4b66f68f1177e3c3650182851b7904c.jpeg "Unreal Engine 4 Tutorial: Attach to Socket (english)") ](https://www.youtube.com/watch?v=-xOoknUDGaE)

Or, if you want the object to be carried or contained by another object, then make an array in the “parent”, of the class type of the object that you want to be carried, and then load it into that. Unload it when you want to access it.

I hope that helps! Add a comment if any of this is unclear or I havent covered what you want to do…

---

<div class="post-metadata">

**Author:** ![TinyTeaTree\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TinyTeaTree\_1](https://forums.unrealengine.com/u/TinyTeaTree_1)\
**Post date:** [November 15, 2014, 12:36pm UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765/4 "2014-11-15T12:36:46Z")

</div>

I think he ment that in the hierarchy in the scene he wants the ability to place actors under other actors

---

<div class="post-metadata">

**Author:** ![TobiasRusjan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tobiasrusjan/32/1004445_2.png) [@TobiasRusjan](https://forums.unrealengine.com/u/TobiasRusjan)\
**Post date:** [November 17, 2014, 2:12pm UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765/5 "2014-11-17T14:12:28Z")

</div>

Thanks for the answer, robbiecooper, but I was actually refering to what TinyTealTree said: To put a object inside another in the hierarchy of the scene but from code or blueprint. In Unity it was something like object1.transform.parent = object2.transform;

---

<div class="post-metadata">

**Author:** ![TobiasRusjan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tobiasrusjan/32/1004445_2.png) [@TobiasRusjan](https://forums.unrealengine.com/u/TobiasRusjan)\
**Post date:** [November 17, 2014, 2:15pm UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765/6 "2014-11-17T14:15:28Z")

</div>

Nope, I was wondering the same (like in Unity: transform.parent) but there isn’t any property like that :S

---

<div class="post-metadata">

**Author:** ![TinyTeaTree\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TinyTeaTree\_1](https://forums.unrealengine.com/u/TinyTeaTree_1)\
**Post date:** [November 18, 2014, 12:46am UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765/7 "2014-11-18T00:46:37Z")

</div>

The difference between Unity and Unreal in this regard is that each Unreal class has an in built heirarchy inside of it. and you can parent it over there in code with -\>AttachParent = or something like that. I approve that it creates a confusion because the main hierarchy is somewhat ambiguous towards what its supposed to be doing.

---

<div class="post-metadata">

**Author:** ![Palaui22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Palaui22](https://forums.unrealengine.com/u/Palaui22)\
**Post date:** [May 23, 2016, 8:06am UTC](https://forums.unrealengine.com/t/parent-objects-in-scene/298765/8 "2016-05-23T08:06:39Z")

</div>

Hi!!!

Maybe a bit too late, but this is the way I do it:

ChildObjectIWantToAttach-\>AttachRootComponentTo(RootComponentOfTheParent);
