Does anyone know simple solution to get my web streaming build to work properly. I’m just coming back to Unity after about a 6 month absence so a simple step by step would be great. I’m using Dreamweaver for web design.
Yesterday I tried to publish a prototype game to a web page. The html page wassuccessfully uploaded but instead of displaying the game it shows the following error: Failed to download data file. Do I need to upload the asset files to the server? More likely I looked at an article under Unity Support and there were about 4 examples of Javascript code that went on about some very technical ‘call’ situations, but never got down to exactly which code or an example of one code that one could add somewhere in the Html and make it work.
Lots of people are creating and posting web player content successfull so we need to sort out where yours is breaking and my first two guesses are that either (a) the file is damaged during upload or that (b) your server isn’t delivering the file properly.
Did you use the default HTML produced when you build a web player or did you modify it or use your own?
Does the same content work locally and not on the server?
Does your server have the mime-types configured properly?
Thanks for responding!
I did use the original HTML. I did not modify or alter it in any way. I put it in my site root folder. Then uploaded it.
The videogame works locally perfectly. It is a test of publishing to a website, so it is not complete by any means and utilizes Lerpz and your robot animation.
What is the mime type to check with my web host, GoDaddy! I will be very grateful if you can solve this riddle for me. Another question I had was if Unity works or interacts with Adobe Flash? I see the scripting is similar.
Good question Eric. I’m pretty sure I did. At one point uploaded the
whole asset folder. I removed the asset folder and don’t remember if I uploaded
the data file on the next attempt. I’m in the process of uploading new ‘HTML build’ and data file now.
Apparently one can only attach one file at a time, so here is the latest HTML, to be followed by data file.
The .unity3d file isn’t there. There is a file that was built and put in the same folder as the HTML that was generated. You will have to upload that too, or it won’t work.
You don’t need to upload the asset folder and unless you were saving your web player build to the asset folder (not sure why you would do that), uploading it won’t help.
As Charles indicated you need to upload both the HTML file and the Unity web player data file (needs to be named MazeTest.unity3d and it needs to be uploaded into the same folder as the HTML file). Failure to upload the *.uniyt3d file, failure to use a file name of MazeTest.unity3d, or failure to upload that file into the same folder as your HTML file will all result in breakage.
Note: also as Charles said, uploading the asset folder isn’t gonna do it for you. When you built your web player a HTML and a unity3d file were created, you only upload those two items, nothing else.
You need to have application/vnd.unity registered on the server as that’s the mime type for Unity 2 authored content.
Eric touched on this already in that you cannot incorporate Flash content inside your Unity content, nor can you incorporate Unity content inside of Flash content. That doesn’t mean that the two can’t interact though. Both the Unity Web Player and the Flash Player support content-to-browser communication, meaning there is bi-directional communication between your content and browser-based JavaScript code that you write. Using browser-based JavaScript code as a bridge you can have Unity content and Flash content meaningfully interact if desired. That may or may not be what you’re after but I thought it was worth mentioning anyway.
Thanks for all the great suggestions everyone. I’m about at wits end. I was also having hardware problems, had a bad router. So it was frustrated by the upload losing connections half way through. So…I received and configured my replacement unit. First thing I did was build a new HTML and data file. The data file is just over 10mb. After uploading both, in the same folder, I still could not access the Unity Html page. I got an error on my PC(where Dreamweaver is) saying that the Unity Data file is corrupt. So, I tried uploading from my Mac via Fetch, thinking that moving the file from Mac to PC was the corruptor! Alas, I still get can’t open the Unity HTML and get an error: Failed to download data file. I got this same error on the PC before clicking button that revealed that the file was corrupt and not a Unity Player file!
I’m trying to add it to a web portfolio I’m building. I’d like to put a brief example of a Unity game on there. I’m still open to suggestions! Thanks again.
Citing Dreamweaver means nothing as the Unity content will not load and play inside Dreamweaver at all and it won’t affect your files in any way.
Note: I’m a long-time Dreamweaver user myself.
Before clicking what button?
Do this if you would, send me (via email) your HTML and your web player data file, I will upload them to a temporary location for you as a test (using Dreamweaver on my Mac ). I really don’t know what’s going on here but at least that way I can help sort out whether there really is any file damage or corruption going on.
Thanks everyone for the advise and support. Finally the web page is able to display and play the Unity game. It took convincing a couple of tier levels but finally got done. Setting or configuring the mime type seemed to be the problem. Now on to designing the game.