- Home /
Where to save.xmls to be reponed later in compiled game.
I set up a save system and a load system and these worked in the editor but once I compiled those paths didnt work. I have a folder called data in my assets and saved them to that using:
Application.dataPath + "/data" + save + ".xml"
and loaded them using
Application.dataPath + "/data"
This worked great in the editor but once I compiled the game the files paths must have changed. What directory do I use to get my save/load system to work in a compiled build?
Answer by DaveA · Aug 15, 2012 at 04:51 PM
When you build, it makes a .exe and a folder with roughly the same name, but with _data appended. That folder is your dataPath. So make a folder under that called 'data'. But be warned, when you rebuild your project, that whole folder structure is wiped clean. So you make want to make a build script that copies those files from your Assets to that folder after the build.
Your answer
![](https://koobas.hobune.stream/wayback/20220613075716im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Load Text File From Remote Source 0 Answers
Write a binary file (save game data) 0 Answers
Save and Load Questions 0 Answers