Doubts with the DataAssets , AssetManager, and the ItemID , how can i implement ?

I was following a tutorial, for make a data asset for an inventory, but in determined point, i have troubles with the FPrimaryAssetID , I’m working inside of a plugin that i build together with the project, in my plugin i have a submodule, and inside of this, i create a class of ItemData that inherits of UPrimaryDataAsset, and the tutorial says me that for the ID i need to put the next code: UPROPERTY(EditDefaultsOnly, BlueprintReadOnly,Category=“Item”)
//Example: “Item.Knife”
FPrimaryAssetId ItemID;

The tutorial says that i need to create a data asset blueprint , that inherit from my ItemData, and in this DataAsset i can put the ID, in the next style, Item.Knife , the tutorial don’t clarify how to edit, and set the asset manager, and when i try to write in the item ID, of my Item.Knife, i can’t write anything, the only thing that i can put is a reference of primary assets like in the image 1 in the ItemID space, but i can’t write the text Item.Knife, anybody knows how can i work in this, and make that this works , because i don’t understand , what’s the problem or how can i put the id’s with that format.

i feel like he meant for it to be a GameplayTag?

No, GameplayTag is another thing, gameplaytag like its name say, is for tags in general, and primary asset id is for DataAssets classes

yep i understand but your example wouldnt be “Item.Knife”

the FPrimaryAssetID is more like an FName to a PrimaryAssetType i think, maybe its not showing up because you havent added the PrimaryAssetType to the AssetManager in ProjectSettings

I think that item.MyItem is not ment to be literal. It is representing FPrimaryAssetId(FPrimaryAssetType(“Item”), FName(“MyItem”)) as a hierarchy.

Try:

UCLASS(BlueprintType)
class UItemData : public UPrimaryDataAsset
{
	GENERATED_BODY()
	
public:
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Item")
	FName ItemID;

private:
	FPrimaryAssetId GetPrimaryAssetId() const override { return FPrimaryAssetId("ItemData", ItemID); }
};
Then in the Data Asset that inherits:

Asset Manager:

Result:

1 Like