# How to create Item Classes that inherits each other?

**URL:** <https://forums.unrealengine.com/t/how-to-create-item-classes-that-inherits-each-other/320066>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 28, 2015, 10:44pm UTC](https://forums.unrealengine.com/t/how-to-create-item-classes-that-inherits-each-other/320066 "2015-05-28T22:44:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_31c1e214](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_31c1e214](https://forums.unrealengine.com/u/anonymous_user_31c1e214)\
**Post date:** [May 28, 2015, 10:44pm UTC](https://forums.unrealengine.com/t/how-to-create-item-classes-that-inherits-each-other/320066/1 "2015-05-28T22:44:33Z")

</div>

Hello guys,

I recently changed my game engine Unity to Unreal Engine. I am a C# programmer and I was using too much inheritance in my game when I was using Unity. But when language changed to C++, things became confused to me.

I wanna learn that can I create inheritance in C++, like i was doing in C#. I don’t what type of parent I should select(actor,pawn …) but in Unity they derives from nothing.

Inheritence that i am looking for:

 ![44472-inh.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/f/7ffde8359884a3bd9d1797bc4b0418fcea0eb79e.png)

For example , i will be able to equip X from my Inventory.

EXTRA question: Am I able to do this system with Blueprints, especially abstract classes with bluprint is possible ?

Sorry for my bad english,

Thank you :))

---

<div class="post-metadata">

**Author:** ![Spiris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spiris](https://forums.unrealengine.com/u/Spiris)\
**Post date:** [May 29, 2015, 12:42am UTC](https://forums.unrealengine.com/t/how-to-create-item-classes-that-inherits-each-other/320066/2 "2015-05-29T00:42:56Z")

</div>

Hello Skyechuu!

First and foremost, if you are really interested in getting into the nitty gritty realm of C++, you should check out [Rama’s C++ Guide](https://wiki.unrealengine.com/Entry_Level_Guide_to_UE4_C%2B%2B).

It will answer many, but not all questions as you come across them. For now though, if you want to do inheritance in C++ you would do something like this:

In your header file:

> `UCLASS()`  
> `class Item : public AActor`  
> `{`

(This goes on to generated body, constructor, properties, function declarations, etc.)

Then if you wanted you could continue to extend additional classes you could have Weapon : public Item, you could extend from different classes like Pawn, or UObject, or even go with a USTRUCT. Good stuff.

As for your bonus question, This is all easily achievable in blueprints! In fact Epic even made a fairly well thought out and [Community Influenced Tutorial](https://wiki.unrealengine.com/Unreal_Motion_Graphics_%28UMG%29_UI_-_Inventory_Tutorial_Playlist) on the topic.

Hope this helps get you started!

-Spiris

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_31c1e214](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_31c1e214](https://forums.unrealengine.com/u/anonymous_user_31c1e214)\
**Post date:** [May 29, 2015, 4:22am UTC](https://forums.unrealengine.com/t/how-to-create-item-classes-that-inherits-each-other/320066/3 "2015-05-29T04:22:54Z")

</div>

Thanks a lot for those informations 🙂
