I’ve been trying to figure out it for quite a while right now, without any luck.
Setup that use just FStringAssetReference works fine, and looks temporally like that:
FString usless;
FARItemData* data = ChestItemDataTable->FindRow<FARItemData>("1", usless);
FStringAssetReference itemCl = data->ItemBlueprint.ToStringReference();
UBlueprint* gen = Cast<UBlueprint>(itemCl.ResolveObject());
AARArmor* itemAc = GetWorld()->SpawnActor<AARArmor>(gen->GeneratedClass, SpawnInfo);
USTRUCT(BlueprintType)
struct FARItemData : public FTableRowBase
{
GENERATED_USTRUCT_BODY()
public:
FARItemData()
: ItemBlueprint(NULL)
{}
UPROPERTY(BlueprintReadOnly, Category = "Item")
TAssetSubclassOf<class AARItem> ItemBlueprint;
};
It loads asset and spawn proper actor.
How do I do it without FStringAssetReference ?
I tried that:
FStringClassReference itemClass;
itemClass.ResolveClass();
And that:
data->ItemBlueprint.Get();
When passign to spawn actor. The problem with FStringClassReference is it that TAssetSubclassOf, ToStringReference() return FAssetStringReference not FStringClassReference.
But regardless of then when I hardcoded path in FStringClassReference it still didn’t worked.