Is there any way to import a texture in game during runtime?

Is there any way to import a texture in game during runtime? If possible I would also like to be able to do it in blueprints? Thanks!

I can tell you that you can import a texture and use it as a parameter in a dynamic material. The BP node is [Import File as Texture 2D].

However, I can’t tell you how you can save it or how you can get a file selection window in blueprints. Maybe there is a way, I just don’t know it =)

thanks anyone else is welcome to answer

This can help, but I am not sure

It is possible, I’m sure you can find a blue print node to do this but in C++ all you need to do is the following:

FString FilePath = "C:/Users/MyUser/Images/MyImage.png";
UTexture2D* MyTexture = FImageUtils::ImportFileAsTexture2D(FilePath);

If you know where the image file is within your game directory and you know what the name is then you can use:
FString FileName = FPaths::ProjectPersistentDownloadDir()+“imageName.png”

You can google for each function name followed by UE4 blueprint and you’’ get your nodes.

2 Likes