D3lanK
(D3lanK)
July 16, 2021, 8:19pm
3
The class being returned is just a generic Blueprint class, and so you will need to get the actual asset class and then use the Spawn Actor from Class node. Below is a blueprint node that will get the actual class of the asset.
UFUNCTION(BlueprintCallable, Category = Loading)
static UClass* GetClassFromAssetData(const FAssetData& InAssetData);
UClass* URPGBlueprintLibrary::GetClassFromAssetData(const FAssetData& InAssetData)
{
FString ObjPath = InAssetData.ObjectPath.ToString().Append("_C");
return StaticLoadClass(UObject::StaticClass(), NULL, *ObjPath, NULL, LOAD_None, NULL);
}
PublicDependencyModuleNames.AddRange(
new string[] { “AssetRegistry”}
);
Modified From:
EverNewJoy:master ← EvoPulseGaming:master
opened 04:45AM - 18 Nov 17 UTC
/**
* Get UClass from assets found with AssetManager (Purple Class node)
* Use… this to get Assets by Path, Class Type ect.
* Use GET ASSET REGISTRY node -> GET ASSETS node -> as your input to this
* Using correct class checking and casting, this can be used for spawning actors, getting class defaults, using textures, sounds ect.
* COOKED BUILDS: : Make sure your assets/folders are manually added to cooked build if they are not used directly in Editor.
* On-the-fly asset list creation or add DLC content, no lookup tables!
*/
Example:



