Loading Blueprints with ObjectLibrary
I am trying to load a set of Blueprints from a path with the object library. These Blueprints are the lowest part in the following inheritance tree:
AFurniture (C++) -> FurnitureBP (Blueprint) -> Chair, Table, Carpet (Blueprints)
All these Blueprints (Chair, Table, etc) are in the same path and I am trying to load them with the following code:
The problem is that I do not know how to get the proper UClass from each element. I think they are detected ok as I can call BluePrint->GetName() and get the proper names (Chair, Table, etc), but I need the UClass to be able to spawn them in game.
Is this the right way to do it?
asked Mar 09 '16 at 10:44 AM in C++ Programming
Hey, I just had a very similar problem and found the solution! If you want to load Blueprint classes you should use ObjectLibrary->GetBlueprintsFromPath like this:
And then you need to use GetObjects instead of GetAssetDataList like so:
Also UBlueprint's do not exist in a packaged game, this would cause a crash. Hope that helps!
answered Mar 09 '16 at 04:03 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here