- Home /
Javascript Fatal Content Error from Space Shooter tutorial in Chrome web build
I've completed the Space Shooter tutorial, so my C# code is identical to that of the tutorial (except I've replaced the GUIText-related code for new UI code).
The game runs as expected within Unity, but following the completion of lesson 17 ("Building the game"), it gives the error in the web player with a JavaScript Alert: "The content was stopped because a fatal content error has been detected". Error screenshot below. The background sound loop for the game DOES play, and continues to play after I close the Chrome tab (but ceases after I close Chrome entirely). For reference, I'm on OS X 10.9.5 and Chrome 39.0.2171.95.
My only clue as to what might be going on: In the very beginning of the tutorial, I checked/set the Build Settings, and noticed a scene mysteriously already there. I think it was titled "xx_scenes/Main.unity". It was grayed out, with its checkbox un-clickable. Since the checkbox was un-clicked, I ignored it when I eventually built the game for the web. After getting this error the first time, I deleted said scene from that list, but the error remains after rebuilding.
Other than that, perhaps my differing UI code is causing the error? That's the only other difference I can think of between my local environment and the tutorial. I'm not sure how to go about troubleshooting this error, as I have no familiarity with Javascript or the Unity web player, and the error doesn't show up in any tests within Unity.
I have the exact same problem. It would be nice to know whats wrong.
just completed the tutorial and have this identical issue.
it must be the new UI because if i disable the canvas that contains all the ui texts (Score, Restart, Gameover) and reBUILD, it works.
what i have done, is in unity added a ui text as a child of canvas in the hierarchy for each (score, restart & gameover). in the script for the GameController added the line: " using UnityEngine.UI; " at the top and changed GUIText to Text in the public variable declaration.
this worked in the build for the roll a ball tutorial but not here. not sure why.
curious if anyone has found information for this space shooter tutorial using the new GUI?
Yes i did exactly the same with the new UI text and it also fails. Is there a way to get to the legacy GUI text?
Answer by tonza · Jan 14, 2015 at 12:57 AM
Check this out.
http://stackoverflow.com/questions/27912745/unity-webplayer-crashes-with-ui-text-new-canvas-text
this worked brilliantly - thank you.
the above link in short: edit > project settings > graphics
in the inspector window "diffuse" is most likely the only shader there. click on the cog wheel (gear icon) and "reset". this will add the "ui/default" & "ui/default font".
rebuild your project and it should work now.
thanks again :)