TSubclassOf
can be assigned the class AItem
, not an instance of AItem
.
E.g.
UPROPERTY(...)
TSubclassOf<AItem> Item;
...
Item = AItem::StaticClass();
Item = ASwordItem::StaticClass();
If the intent is to have Item
be an instance of AItem
or any subclass, the proper declaration is:
E.g.
UPROPERTY(...)
AItem *Item;
...
Item = NewObject();
Item = ASwordItem();