- Home /
Web build doesn't recognize text file
Hi there,
I finished a game I made for a year long project and now I want to publish it on the web. As a standalone application, the game works fine, I've even shown it at several events. However, when I try to deploy my game into a web build it seems especially prone to glitching and just doesn't work.
The reason for this, I'm pretty sure, is because the backbone of part of the game rests on a text file that it normally reads to display text and decide certain aspects of the game in the programming and the web version does not want to read it. In the regular version, the text file is placed in the main folder. In the web version, it doesn't read the text file at all, even if it has its own private folder with the text file in it.
I'm not exactly sure how to make the web build recognize the text file or if that's even possible. Anyone have any ideas?
I've never faced this problem, but I read a lot of Unity Q&A. What I believe based on that reading:
You cannot read it from the user's machine
If the data is static, then you can get easy access using a TextAsset in your Assets or Assets/Resources folders.
You can access the file from the net using the WWW class.
You likely can read the file from the same server that is hosting the app. This may require specific entries in the crossdomain.xml file.
https://docs.unity3d.com/Documentation/$$anonymous$$anual/SecuritySandbox.html