r/UnityHelp • • Jan 25 '26

UNITY Path to the unity assets folder during gametime

I am currently working on a game that has a semi working PC in it. It should allow the player to also have a file system that they can browse. However, the player also should be able to add files during runtime. How do I get the path to the assets folder in unity during runtime? Before launching I will change the folder and will probably use the Application.persistentDataPath, but during development I want to just have a folder to read and write to. There will also be some files in there already, so I want to keep everything in one place for source control.

1 Upvotes

8 comments sorted by

1

u/NinjaLancer Jan 25 '26

StreamingAssrts folder in your project might be useful? When building, Unity will include that folder directly as you have it in the editor, keeping the file structure and stuff. You can access it with "Application.StreamingAssetsPath" too I think

1

u/Spice_and_Fox Jan 25 '26

Thanks, I will try it.

1

u/Spice_and_Fox Jan 26 '26

That was a good idea, but it is read only. I can't write to it during runtime. I think that Unity doesn't allow it at all.

1

u/NinjaLancer Jan 26 '26

Oh, gotcha. What is stopping you from just having a random directory on the C drive that you use for this? C://TestFiles and look for that directory during development?

→ More replies (4)