Hello Guys,
So currently I am trying to make an editor utility widget which spawns custom blueprint classes in the editor. This is supposed to assist my team in selecting several hundred of blueprint actors and spawning them in specified locations. The blueprint classes are parented to the AActor class.
I have tried several implementations such as the one in this post:
Load / Spawn Blueprint Actor Asset from C++ w/o Prev. Ref. | Epic Developer Community (epicgames.com)
However the soft class ptr returns null whether I use hardcoded path references (for testing) or dynamically load the object.
Another implementation I tested out was in the following post:
(UE5) How to spawn blueprint actor with C++? - Programming & Scripting / Blueprint - Epic Developer Community Forums (unrealengine.com)
However this primarily returns an error stating that the class I have selected being Blueprint can not be spawned because it is not an Actor. I need the specific class to spawned.
In order to circumnavigate this problem I wrapped the selected assets in a parent c++ class and tried spawning them however that spawns the parent class rather than the actual blueprint I want to spawn. It’s necessary for me to spawn the blueprint.
I’ve looked at some Unreal libraries to try to call their AddActor or SpawnActor Functions however, so far I am unsuccessful. Is there any possible way to spawn my selected Blueprints in the editor?
Also, side note, I looked at the console in my IDE when dragging and dropping the blueprints in the world and it shows that it uses the Actor Factory library but not much other information is provided. If I can see where in the engine similar on drop functionality is being handled I might be able to implement it myself. Any pointers or information in this matter will help a lot.
If any further information is needed, do let me know.
Regards