I was trying to make a game that is going to read some stuff from a txt file. My goal is that i want to be able to put files in the folder from an ingame editor or external sources. One of my problems is that i don’t know how to make a dedicated folder that i can easily find and open in the windows explorer. The other is that i dont know how to create a new file txt in that specific folder.
Any code examples are appreciated.
Generally you’l want to use either the persistent data path or the streaming assets folder, depending on if any of these text files need to originate with the build and what platform you are targeting.
But Unity can do any regular C# file access stuff (see any C# tutorial or forum thread on reading/writing text files, doesn’t need to be Unity related), so on target platforms which aren’t locked down the folder can be wherever you want really. Mobile and WebGL are extremely limited here, while Windows/Mac/Linux you can do anywhere so long as the user’s account has access to the folder.
1 Like