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.
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.
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 on the topic.