Download

Spawn Asset From Name

I have asked this in the AnswerHub without an answer, so I thought I give it another shot:

Is there a way to spawn an actor given nothing but the name of the Blueprint class and the path to the BP?

I have spent two days without a solution. I tried BP and I tried C++. I can’t use the SpawnActor C++ call because the BP is defined in the editor and thus doesn’t exist in C++. I tried loading a class object in C++ based on the name but to no avail. When I get the object in C++, it’s class is “Blueprint” which can not be cast to “Actor”.

The only way to spawn an actor based on a BP is to hardcode it in an immense branching monster with endless if’s and else’s and then give the respective BP class manually in the drop down list in every single SpawnActor node.

Is that really how it’s supposed to be?