- Home /
Unity Cloud Build webgl read data from text file problem.
I am using Unity Cloud Build through Bitbucket-Sourcetree. In my game I read some text from a file in the project folder and use it. When I build in my windows laptop in form of .exe file it works perfectly. However when I push the project to Bitbucket for continuous integration and build it as webgl, the build is unable to read from the text file. The game build works fine in other aspects. Even though the text file is present in the Bitbucket folder. One reason might be the fact that when I read the data using the following command I am hard coding the location of the text which might be a problem in remote building.
StreamReader reader = new StreamReader(@"C:\Users...\Assets\Text.txt");
How exactly can this be resolved? Am I supposed to put the text file at a very specific location or should I give the location of the text file in a more general way which would be independent of the system it is running in?