Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question WebGL doesn't load

Discussion in 'Web' started by SoftwareGeezers, Jul 27, 2023.

  1. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    904
    Asked this in the wrong place. :oops:

    I'm trying a Web build for the first time ever. The build launches in Firefox but the loading screen doesn't show any progress. Unity 2022.3.1f1


    Found how to get error messages:

    Image2.png

    Edit: From here, disabling Brotli compression fixed this loading error.
     
    Last edited: Jul 28, 2023
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,450
    You need to make changes to see what works and what doesn't since we don't know nothing about your project, and the errors are non-descriptive. Have you tried building a new, empty project? Other browsers? Various build/player settings?
     
  3. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    904
    Clean new, empty WebGL 2022.3.1f1 project has the same issue - nothing loads.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,450
    How do you run it? Under Build Settings use "Build & Run" because if you build it and try to run it locally by opening the html file it won't work without a webserver running (something like that).

    And be sure to check another browser. I recently did an URP postprocessing test for WebGL and both on my and a friend's machine it would run only at 35 fps looking in a specific direction, whereas Chrome ran the same spot with >60 fps. A few years back it used to be the opposite where Firefox was typically fastest for WebGL. Not sure what happened there, or whether it simply doesn't do postprocessing very well.
     
  5. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    904
    Yes, build and run. Basic 2D template. I can build and launch into FF from Unity 2020 but not 2022. Is there a way to redirect the launch browser or do I need to change my Windows default?

    Searching the net, disabling Brotli compression for Gzip fixes the app loading.
     
    Last edited: Jul 28, 2023
  6. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,450
    I think it uses the default browser.
    You can also install the WebGL Publisher package from Package Manager and upload it directly to Unity Play so you can always play the latest version and share it with others.
     
    SoftwareGeezers likes this.
  7. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    904
    Was thinking about itchIO - forgot about Unity Play.