How to Create a map with a class reference?

Hey there , I would like to re create the following Map in c++

The ABP quinn is just an example for showing the class reference

Well

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Variables")
		TSubclassOf<ACrafting_System> Item_Cat;

	

	void MyClassConstructor()
	{
		Item_Cat = ACrafting_System::StaticClass();
	}

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Variables")
		TMap<Item_Cat,int> YourMap;

I tried to use the TSubClassOf but it didnt worked
I got the following error “‘Item_Cat’ - type must be a UCLASS, USTRUCT, UENUM, or global delegate.”

Thank you for the help

Nevermind i solved it for me it was
TMap<TSubclassOf< class ACrafting_System >,int> YourMap;

1 Like