Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've made a simple game but when I tried to load this on chrome its not loading.

I am building for WebGL (HTML 5). I am getting these errors when the page loads.

Unity version - 5.3.1f1 Chrome version - 47.0.2526.106 m

Its working fine on firefox .

XMLHttpRequest cannot load file:///C:/Users/Public/Documents/Unity%20Projects/Box%20Shooter/HTML5%20Builds/Release/HTML5%20Builds.js. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.LoadCompressedFile @ UnityLoader.js:1
UnityLoader.js:1 XMLHttpRequest cannot load file:///C:/Users/Public/Documents/Unity%20Projects/Box%20Shooter/HTML5%20Builds/Release/HTML5%20Builds.jsgz. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.DecompressAndLoadFile @ UnityLoader.js:1
UnityLoader.js:1 XMLHttpRequest cannot load file:///C:/Users/Public/Documents/Unity%20Projects/Box%20Shooter/HTML5%20Builds/Release/HTML5%20Builds.mem. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.LoadCompressedFile @ UnityLoader.js:1
UnityLoader.js:1 XMLHttpRequest cannot load file:///C:/Users/Public/Documents/Unity%20Projects/Box%20Shooter/HTML5%20Builds/Release/HTML5%20Builds.memgz. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.DecompressAndLoadFile @ UnityLoader.js:1
UnityLoader.js:1 XMLHttpRequest cannot load file:///C:/Users/Public/Documents/Unity%20Projects/Box%20Shooter/HTML5%20Builds/Release/HTML5%20Builds.data. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.LoadCompressedFile @ UnityLoader.js:1
UnityLoader.js:1 XMLHttpRequest cannot load file:///C:/Users/Public/Documents/Unity%20Projects/Box%20Shooter/HTML5%20Builds/Release/HTML5%20Builds.datagz. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

Why its not loading up on chrome ?

share|improve this question
up vote 1 down vote accepted

I believe the issue is occuring because you are running it locally rather than on a webserver or an emulated webserver.

Basically: You need it to say http:// or https:// or whatever rather than file:// in the address bar

If you have a webserver, try uploading it there. If not, check out WAMP or XAMPP

I can recommend WAMP for people with little to no experience in "webserver emulation", but remember to either quit Skype or change the port which Skype uses as WAMP will use the same port which doesn't work.

share|improve this answer
    
ok let me check – Shantanu Singh Jan 4 at 12:52
    
I uploaded the .html file on kongregate and its not loading there too. – Shantanu Singh Jan 4 at 13:31
    
If you only uploaded the HTML then it won't work at all. You need the other files too. I'm not sure how Kongregate handles WebGL games so you might wanna ask them on a support email or something. Last time I checked they didn't support WebGL but they did support HTML files with frames which basically just shows a different website. I'd still recommend getting it to work with WAMP. There should be a bunch of guides online which tell you how to set WAMP up. How much experience do you have in web development? – HappyGuyDK Jan 4 at 14:04
    
not much, know basic HTML and CSS – Shantanu Singh Jan 4 at 14:14
    
zipping and uploading .zip file is working on kongregate . Ultimately that's what I wanted . – Shantanu Singh Jan 4 at 14:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.