Home > other >  Unity issued webGL across the source problem
Unity issued webGL across the source problem

Time:09-19

Do a webGL projects, some of which the scene model are packaged into AssetBundle, drop it on the server, and then run the program, through the WWW loading scene model, in the unity editor running everything is all right, but, after the project to generate webGL opens at index. The HTML, interface is just an empty scene, scene model doesn't need to download them from the server, open the console, appear the following error:
Have to stop across the source request: the same-origin policy prohibit reading at http://192.168.1.143:8080/ky/u3d/loadMode_load.do a remote resource, the (reason: CORS head lack 'Access - Control - Allow - Origin),
Check a lot of the things on the Internet, but didn't succeed, don't know what reason is caused? Because is just contact soon webGL, a lot of things is not very understanding, if someone also encountered similar problems and solve, hope can provide the help, thank you!!!

CodePudding user response:

The document has introduced: https://docs.unity3d.com/Manual/webgl-networking.html
The web server configuration files you need to add headers,
  • Related