How to get last inherited class in parent class in C++

Im making an inventory in C++ and i have a structure (ItemInfo) that contains the class of this item. Also i have base c++ actor class - ItemBase. In the constructor of ItemBase i set up ItemInfo.ItemClass by calling GetClass(), but it always returns ItemBase class and when Im creating a blueprint child of ItemBase (Item_Camera), it has the “ItemBase” value instead of Item_Camera. How can i fix this, so that when i were creating a child of ItemBase, it would automaticly set ItemInfo.ItemClass to the class of created blueprint. P.S Sorry for my bad English.

At the point where the base constructor is called the object is still essentially an instance of the base class so you can’t use the constructor to set this value. I add this info just prior to saving the object at which time it should work as you expect.

As staticvoidlol mentioned, in constructor you shouldn’t call any method that has some virtualization. You can check actor lifecycle

and decide. For example, you can use OnConstruction(const FTransform& Transform).