Where is the editor running the game from?

My game loads a parameter file off the drive. Right now I’ve got the location hard coded to one on my machine. But, i want to just include this file in the same directory as the .exe in a build. That works. I build the game, drop the file in the directory with a .exe that doesn’t look for the file in any particular place and all is well.

If I wanted to make that file available to the editor builds while I’m working on it, without hard-coding its location, where would I put it so that the program would find it?

EDIT:: Never mind, but thanks for looking. It suffices to place it in the same directory as the project files.

The correct place for what you’re describing is inside the StreamingAssets folder: Unity - Manual: Streaming Assets

It’s true that while in the editor, you can simply place your file in the Assets folder anywhere, but once you build your game it won’t work anymore. But if you include the file in StreamingAssets, it will be copied verbatim to the built game.

1 Like

Thank you sir!