Spawning a blueprint from FSoftObjectPath?

Hello,

I used a FStreamableManager to load a Tarray of FSoftObjectPath.

TArray<FSoftObjectPath> Lib00SoftObjectPaths;
Streamable.RequestAsyncLoad(Lib00SoftObjectPaths, FStreamableDelegate::CreateUObject(this, &AYagUIBranchMain::FillCircle00));

Now i’m in the delegate and would like to spawn those loaded objects.

They are all blueprint assets.

The problem is that when trying to get the class for the UWorld::SpawnActor function, the only thing i could find was this:

Lib01SoftObjectPaths[i].ResolveObject()->GetClass()

But this always gives the same class “Blueprint”, and SpawnActor doesn’t want to spawn that.

Any advice on how i should proceed ?

Thanks

Cedric

Hi. You just need to take this UBlueprint class (if it is valid) and check it’s GeneratedClass member. There will be a class you really need. But this can be null when blueprint is not properly compiled (And you can’t spawn an object if it’s happened).

Hey, exactly the pointer i needed, thanks a lot !