Load asset at runtime from File System

Hi to all, I’m a beginner with Unreal Development:

I need to load an asset at “runtime” (like: 3d model file and texture) from “File System”, place it under local content folder (for example: “/Game/”) and use it after.

I’ve tried to execute the following code and it gives me an exception if I launch the game with its process:

FAssetToolsModule& AssetToolsModule = FModuleManager::LoadModuleChecked<FAssetToolsModule> ("AssetTools");
TArray<UObject*> ImportedObjects = AssetToolsModule.Get().ImportAssets("/Game/"); // CRASH HERE
            
// Rest of code

Please could you give me a sample code or an alternative way to do it!

Bye

#Illegal

For legal reasons you are not allowed to load assets at runtime and save them to your project directory.

People need to have the Editor and use the editor, and none of this would work in a packaged game for sure :slight_smile:

The original design must be re-thought :slight_smile:

Rama

Ok, Rama, and what about moddable function? Does it far from loading assets to the game directly?

I think the issue is that if you were allowed to load assets at run time with ue4, the user could use copy-written material and it would get Epic in trouble. It also opens the possibility of a “SQL Injection” type of attack on the game.

I get that this is a little late, but how does people loading copywritten material into games get Epic in trouble? People can already do that in the editor.