How can I create custom Blueprint "types" in UE4?

Hey guys I have what I think is a quick question (I’m sorry if it’s not). Also I’m sorry if the terminology I’m using is incorrect but I’m just looking for someone to point me in the right direction. :slightly_smiling_face:

I want to create essentially an “item” Blueprint type and I want to be able to make this a UPROPERTY and when I go to set it, it will only allow me to select Blueprints which are “items”.

How do you go about making custom Blueprint types like this in UE4? I don’t know if there is some sort of built in functionality in the engine or what. I’ve done some digging and I feel like this may be related to Gameplay Tags in some way? I’m not sure exactly how those work either to be honest.

Thanks!

I want to create essentially an “item” Blueprint type

use blueprint type specifier so that you can store it in variables in blueprints.
use blueprintable specifier so that you can derive blueprint classes from UItem.

UCLASS(BlueprintType, Blueprintable)
class YourProject_API UItem : public UObject
{
      //stuff
};

I want to be able to make this a UPROPERTY and when I go to set it, it will only allow me to select Blueprints which are “items”

use TSubClassOf instead of UClass* so you will be able to select blueprint classes of UItem type only.

//in some other class

UPROPERTY(EditAnywhere, Category="Item")
TSubClassOf<UItem> MyItemClass

if you want your item to be data assets like texture, material etc.
you can derive UItem not from UObject but from UDataAsset.

2 Likes