# Child of object is directly of object class, why?

**URL:** <https://forums.unrealengine.com/t/child-of-object-is-directly-of-object-class-why/431370>\
**Category:** Blueprint\
**Tags:** child-class, unreal-engine, Blueprint, question\
**Created:** [August 10, 2018, 2:21pm UTC](https://forums.unrealengine.com/t/child-of-object-is-directly-of-object-class-why/431370 "2018-08-10T14:21:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_nikola](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@the\_nikola](https://forums.unrealengine.com/u/the_nikola)\
**Post date:** [August 10, 2018, 2:21pm UTC](https://forums.unrealengine.com/t/child-of-object-is-directly-of-object-class-why/431370/1 "2018-08-10T14:21:25Z")

</div>

Hi, I’m trying to create a variable of a custom class; let’s call it X; and fill it with children of X.

If I create X as child of `uobjectcore.object`, the children of X will also be direct children of object instead children of X. If X is a child of `character` then children of X are children of X as expected. First and foremost why, and how can I then succed in my original intent?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 11, 2018, 11:59am UTC](https://forums.unrealengine.com/t/child-of-object-is-directly-of-object-class-why/431370/2 "2018-08-11T11:59:00Z")

</div>

Not sure if I follow but:

 ![250153-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/c/d4cde7f510405f549b8b32d223466fee1f085fb6.png)

You can create a variable of type _ImaParent_ or _ImaParent\_Child_ and store a reference to any _ImaParent\_Child_ there.

Fetching _ImaParent\_Child_ from _ImaParent_ reference will require a cast to the correct type, though.

---

<div class="post-metadata">

**Author:** ![the\_nikola](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@the\_nikola](https://forums.unrealengine.com/u/the_nikola)\
**Post date:** [September 21, 2018, 11:14am UTC](https://forums.unrealengine.com/t/child-of-object-is-directly-of-object-class-why/431370/3 "2018-09-21T11:14:06Z")

</div>

Thanks for you response; the answer to my problem was to set the variable type to class instead of object reference. I wasn’t aware of the distinction - you can’t fill a instance reference with an abstract class reference.

Additionally, I must’ve done something else different because now when I create a child of object it is of object, not of uobjectcore.object, though I do not know what the difference is nor how to get uobjectcore.object

---

<div class="post-metadata">

**Author:** ![the\_nikola](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@the\_nikola](https://forums.unrealengine.com/u/the_nikola)\
**Post date:** [September 21, 2018, 11:16am UTC](https://forums.unrealengine.com/t/child-of-object-is-directly-of-object-class-why/431370/4 "2018-09-21T11:16:55Z")

</div>

Fixed - The variable needs to be object reference type to be filled with instances of object (spawned or placed within level), and of class reference type to be filled with an abstract class.

Additionally, I must’ve done something else different because now when I create a child of object it is of object, not of uobjectcore.object class, though I do not know what the difference is (if any) nor how to get uobjectcore.object
