How do i open an hmtl file located on my project folder?

All i need to do is open an html file by clicking an object in the scene. I want the html file loads in a browser window. The html file is located on my project folder.

  1. Ship the HTML file with the game, as a loose file. You can achieve this by placing it in the StreamingAssets folder.

  2. Figure out the URL to the shipped HTML file and call Application.OpenURL. You can use the special file:// protocol to tell the browser to access the local filesystem. Something like this:

    Application.OpenURL(“file:///” + Application.streamingAssetsPath + “/readme.html”);

Note that this will not work on Android or Web Player builds, for the reasons explained here. For Android, you might consider using the WWW class to retrieve the HTML file from the .apk file and copy it somewhere accessible. For Web Player builds, the simplest solution is to host the HTML file on your web server, and call something like:


(If someone is playing a Web Player build, it’s a safe bet they have internet access :slight_smile: )