For those who aren’t familiar, Unity’s “StreamingAssets” has nothing to do with streaming.
Unity’s “StreamingAssets” allows files to be placed into a directory in the project called “StreamingAssets”. Those files are not imported into the editor. When packaging a build, those files are placed (unpackaged) into the build without being archived/packaged up. You can use Unity’s “Application.streamingAssetsPath” to access the file in both in the editor and in the packaged build with the same relative path.
I haven’t yet found anything similar to Unity’s “StreamingAssets” nor Unity’s “Application.streamingAssetsPath”.
This is the closest thing to a solution that I’ve found:
-
Package a game, find the “RunUAT.bat” command in the output log, and copy it.
-
Create a python script that runs the “RunUAT.bat” command and then places the external files into “{build_dir}\WindowsNoEditor\{project_name}\Binaries\Win64\{external_filename}”, next to the .exe file. Now FFileHelper can access the external file with a relative path (path is “.\{external_filename}”)
-
Package a build using the python script from now on.
This solves most of the problems, but it does not allow me to use a relative path in the editor, since when using FFileHelper in the editor, all filepaths are relative to “{unreal_editor_installation}\Engine\Binaries\Win64”.
So, my questions are:
-
Is there any way to automatically include an external (non-imported) file into a UE4 packaged build, and have it not be placed in a pak file?
-
Is there a way to have FFileHelper access this file in both the editor and in a packaged build without knowing the filepath for the Unreal installation nor the filepath for the packaged build?