Trying to get Blueprint asset using AssetRegistryModule.
I am trying to get class reference in my code using the AssetRegistryModule.
This is what i tried:
If i try code above, the game will crash. If i try to add location manually doing little change: FoundClass = FStringClassReference("/Game/Blueprints/BP_EmptyActor.BP_EmptyActor").TryLoadClass();
Game won't crash, but the FoundClass will be empty. I checked and the FString [I]ClassObjectPath [/I] will return the full path for the class, so finding the class isn't the problem here.. I just don't know how to get reference to the class, if i for example want to use it to spawn something. Any ideas what is wrong?
Foundclass is a TSubclassOf
Hey sorry for the delay, I solved this today, and I will left this if someone else need it: Once you have your TArray AssetData; filled with the UBluprint found on your project you can create or do something else like this:
in this case just as demo, I hard coded this to the first element inside the array, cast to UBlueprint and you can access the generated class from there, in my case I simply iterate all UProperties, but you can spawn your stuff, you dont need to use FStringClassReference since you already have all this info anyway in the AssetData
Follow this question
Once you sign in you will be able to subscribe for any updates here