Hello,
So I have been trying to make an inventory system and to do this I have basically set up a USTRUCT for each slot in my inventory which looks like this:
USTRUCT(BlueprintType)
struct FItemSlot {
GENERATED_BODY();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Info)
int32 Quantity;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Info)
TSubclassOf<class AItemBase> Item;
};
Now I have to make the graphical portion, which I have decided to do in Blueprints. When I break this struct in blueprints though, I the TSubclassOf is a class type and not a reference type:
This would be fine, accept when I Get Class Defaults, it does not return The UTexture2D* that I have set up in my ItemBase class. I am not sure if this is because it is a pointer type? Here is my Item Base.h:
UCLASS()
class HORRORGAME_API AItemBase : AActor
{
GENERATED_BODY()
:
// Sets default values for this actor's properties
AItemBase(const FObjectInitializer& ObjectInitializer);
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Item)
USkeletalMeshComponent* Mesh;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Item)
UTexture2D* Image;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Info)
FString Name;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Info)
bool bStackable;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Info)
EItemTag tag;
};
And Here is what happens when I get class Defaults:
By the way, all of my items are blueprints of ItemBase currently, but in the future I will be making the blueprints of ItemWeapon, etc.
Any help is appreciated