I know there is at least one question with similar title but the difference is, I do not want to load the class in my constructor. I want to be able to spawn a blueprint actor as and when required. So far, I have tried a few methods, such as
For StaticLoadObject(), I am using blueprint path in editor and it works. Changing to path with “_C” appended behind will not return a valid result. As for FAssetData, it successfully showed me the names of all blueprints for both editor mode and packaged game, but FAssetData::GetAsset() was uable to return the object because both FindObject and LoadObject failed to return anything.
The game I am doing has a variety of blueprint actors that can be spawned and attached to a character and all of them have a chance to be spawned, depending on what the player choses. So in my point of view, loading them dynamically should help reduce memory usage (I might be wrong on this). I’ll give your function a try and see if i can get it solved. Thanks
Hi there, I have a very similar issue when attempting to spawn blueprint actors at runtime in a packaged game. I’ve been trying to get your LoadBlueprintFromPath function working, but the TSubclassOf<> always appears to be null. I also made sure to set bDontLoadBlueprintOutsideEditor=false.
My goal is to read a blueprint from a .pak file and then spawn it as an actor. The blueprint will inherit from a C++ class. However, for now just to make things more simple, I am instead trying to spawn a blueprint from the Content folder.