Download

Spawn Unloaded Blueprint Classes in World at Startup

I have a Parent Class which derives from AActor, named AMyParentClass. I then make many blueprint classes who use AMyParentClass as their parent. I plan to have many (100s) of such blueprint classes. Since it is important that each one of these blueprints is in the scene, I’d like to automate the process off adding them to the scene, so there is no fear of forgetting to add one of these 100s of blueprints.

My attempt is to create a class named ASpawnManager, deriving from AActor, which will be responsible for spawning each of these blueprints in BeginPlay. However, I am unable to do this because these assets are not loaded (i.e. not in the scene). I wanted tos use GetAllActorsOfClass() to get all AMyParentClass classes, but this only works for spawned actors in the world (see this thread). Similarly, when using AssetRegistry like so:

FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked< FAssetRegistryModule >(FName("AssetRegistry"));

IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();

and getting all assets, I see my asets if I launch in the editor but when I launch in a standalone game, it no longer finds my Blueprint classes that aren’t already placed in the world.

Is there another way to accomplish the goal I’ve set out here, or am I using these functionalities incorrectly? Any insight is much appreciated

In project settings there’s a list somewhere where you can specify assets that should always be loaded.

Thanks for the reply! I ended up being able to do this by putting all relevant BPs in a folder and adding this folder to Project Settings | Packaging | Additional Asset Directories to Cook