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

WebGL Stuck at 90% loading...

Discussion in 'Web' started by ypfurmingo1, May 23, 2018.

  1. ypfurmingo1

    ypfurmingo1

    Joined:
    Mar 30, 2018
    Posts:
    9
    Previously my tool can run in Webgl without any errors:
    Loading3.JPG
    As you can see, there are messages after "UnloadTime"

    Now my tool can't finish loading in Webgl, where it stucks at "UnloadTime" message:
    Loading2.JPG

    And here is how it looks on the web:
    Loading.JPG
    Unresponsive message came out:
    Loading4.JPG

    Please Help!
     

    Attached Files:

    Last edited: May 23, 2018
    dracula0hang likes this.
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    90% of progress bar means all files have been downloaded. At this point, the Unity engine runtime will initialize.

    When did it stop working? Did you make any change to your project or upgraded Unity?
     
  3. ypfurmingo1

    ypfurmingo1

    Joined:
    Mar 30, 2018
    Posts:
    9
    Hi, Marco.

    I have recently transferred my project from an unity account to another. Then, I setup a new project collaboration with my team member (Also, I did some code changes). My team member (who is responsible for making the web build) downloaded my project and built a webgl version of the tool. When I tried to run it that happens.

    It took me some time to found out that when I deep cleared cache and browsing data, the webgl tool can run again.
    But the next time I load the tool again, the same error will happen...
    Is this a familiar issue? I can't seem to find any solution in my search around the internet.

    Memory allocated is 1025MB

    (Update : consistently even after clearing cache, it can only be run in Firefox, Chrome will not run the tool)

    Much thanks.
     
    Last edited: May 23, 2018
  4. ypfurmingo1

    ypfurmingo1

    Joined:
    Mar 30, 2018
    Posts:
    9
    Loading5.JPG
    This is the example of the tool can't be loaded if I did not clear cache and tried to run it in Firefox

    Update: The cached data cost about 50MB each time when we clear cache and load the tool again
     
    Last edited: May 23, 2018
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    I am not familiar with this problem, sorry. It sounds like you may be hitting some browser limit. Maybe a IndexedDB problem but it's hard to say for sure.
     
    kisaragisou likes this.
  6. ypfurmingo1

    ypfurmingo1

    Joined:
    Mar 30, 2018
    Posts:
    9
    Good news!

    Apparently it was nothing related to the IndexedDB problem, I managed to run it after I change all the texture max size limit to lower , which is 256. (Before the duplication of my project, all the texture max size are adjusted to 256, the "not working/duplicated" version having mostly max texture limit of 2048).

    Although the build file size are the same, I guessing somewhere in the WebGL takes time to compress larger size limit textures?

    Hope this can help someone in the future.

    Regards
     
  7. univema1

    univema1

    Joined:
    Mar 20, 2019
    Posts:
    2
    thank you so much . it works for me
     
    CoalesceLanguidly likes this.
  8. arisdev82

    arisdev82

    Joined:
    Feb 27, 2019
    Posts:
    39
    For me seems to be a random bug, probably something to be with memory leaks. In my case i have a lot of textures of multiple sizes and a large scene and everything works well... until i include a box with a collider inside. It's crazy :(
     
  9. Krishna_psk

    Krishna_psk

    Joined:
    Feb 2, 2018
    Posts:
    8
    @Marco-Trivellato, I'm presently converting an android game to Facebook Instant game.. the problem in the loading scene, the loading stops at 90% for 30 - 35 seconds and then the unity splash screen appears.. I'm using Unity 2018.1.6f1.. is there a way to shorten this loading time??
     
  10. UnityProdS

    UnityProdS

    Joined:
    Jan 11, 2014
    Posts:
    44
    Slightly similar issue, I developed a fully functional game which worked all good on ios [Safari] too. At the start I make a few calls to a server side script to validate credentials. The game loads till 90% and waits for almost 30 - 45 mins then initializing the game. So which means the game initializes all fine accept that it takes a lot of time time to initialize. Note the wait time - 30-45 is actually mins and not seconds. What could be the issue?

    On Android its bliss.
     
    Last edited: Aug 11, 2019
  11. pushpendra996

    pushpendra996

    Joined:
    Dec 8, 2018
    Posts:
    4
    I am still facing this issue, I am using UNITY 2019.1.1f1. I am searching for this from the long time but did not get any good luck. I have tried all the possible ways Like - Reducing the Texture, Enable Stripe Code Engine, Change Build compression type and much more. But I am still suffering with this critical issue. I will be very thankful if anyone answer this question.
     
  12. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    To debug long startup times, I recommend using Firefox with its Firefox Profiler add-on, from https://profiler.firefox.com/. That tool can display a timeline of the whole startup process, and can be used to analyze how much time is being spent on each part of the startup sequence. That tool can be used to distinguish between network download time vs Unity engine startup time, among others.
     
    John1515 likes this.
  13. martinpi123

    martinpi123

    Joined:
    Dec 20, 2019
    Posts:
    1
    I have the same problem.
    Luckily I kept the WebGL build of the previous version (unfortunately not the project itself) by uploading the new build to a different directory on the server.

    I have this issue now. Tho old version still runs fine.
    The newer one has more functionality.

    With the old version which runs on my computer, one user reported this problem. Later it worked for him, without any appearent reason.

    My unity version is 2020-10b7.

    The game that doesn't work: http://martinpi.at/games/ThermikTrainerBeta
    The one that does work: http://martinpi.at/games/ThermikTrainer/WebGL
    (instructions in German, I apologize. But you can see that the game starts)
     
  14. mboomer

    mboomer

    Joined:
    May 17, 2020
    Posts:
    1
    I have the same issue with Edge, IE 11.836 doesn't display the game at all but its working ok in Chrome
     
  15. BlueStarGeneral

    BlueStarGeneral

    Joined:
    Jan 19, 2018
    Posts:
    4
    Try disabling WebAssembly Streaming in the Project Settings/Player menu.
     
  16. farhadalam75

    farhadalam75

    Joined:
    Apr 9, 2018
    Posts:
    1
    The same issues happened here.

    Solution:
    First, Make a Development build. [screenshot]
    Then Build again. It will work. Capture.PNG
     
  17. rh73

    rh73

    Joined:
    Feb 3, 2017
    Posts:
    8
    I've run into the same problem when I tried to upload a zipped archive of a project I'm working on to itch.io to test a webGL build of it. (zipped with the built-in compression tool which comes with Win10, using "send to - archive" from the context menu of the build folder in Explorer). After trying out various suggestions I've read online, like disabling logging in the player settings etc, I finally found that disabling compression in the Unity project settings (player settings - publishing settings - compression format - disabled) does the trick, and allowed the project to start up. At least in my situation, as I'm uploading an archive of the build folder. I don't really have an idea why, maybe it's because I previously put gzipped .js files into another archive... And maybe there's another way without disabling compression in Unity, which I haven't found yet. So I'd be thankful for some feedback on this issue.
     
  18. rh73

    rh73

    Joined:
    Feb 3, 2017
    Posts:
    8
    Nope, didn't work.
     
    roamerfree likes this.
  19. AdamSt

    AdamSt

    Joined:
    Jun 2, 2013
    Posts:
    18
    I have the same problem.
    Created new project with unity 2020.1.1f1.
    Changed platform to WebGL.
    Added one Button to SampleScene and saved scene.
    Added scene in build settings to build.

    Builded project and copied to ftp - it runs, but stucks on 90% for 9 mins. Didnt run succesfully even once.

    Tried development build - runs, but shows "development build" in corner. This is not acceptable for production.
     
  20. AdamSt

    AdamSt

    Joined:
    Jun 2, 2013
    Posts:
    18
    Ok, for me the solution was:

    Disabling compression in the Unity project settings (player settings - publishing settings - compression format - disabled) does the trick
     
    Noonf, haidaratn, OldMansolo and 9 others like this.
  21. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    164
    The reason can be the new js loader, the server should be configurated for content encoded headers. You can also switch on "Decompression fallback" for gzip, or configurate your server to show it how to decompress files while loading them

    Unity Documentation about it:
    https://docs.unity3d.com/2020.1/Documentation/Manual/webgl-deploying.html

    And about server config:
    https://docs.unity3d.com/2020.1/Documentation/Manual/webgl-server-configuration-code-samples.html
     
    Last edited: Aug 17, 2020
    ChronusR, nguyen28102000 and Kjelle69 like this.
  22. Propagant

    Propagant

    Joined:
    Nov 18, 2013
    Posts:
    39
    Worked! Thx!
     
  23. GhoulishGames

    GhoulishGames

    Joined:
    Sep 10, 2017
    Posts:
    3
    This worked for me, thank you very much.
     
  24. benleedy

    benleedy

    Joined:
    Aug 29, 2012
    Posts:
    7
    This was exactly my problem and your solution worked perfectly. Thank you!
     
  25. xyronic

    xyronic

    Joined:
    Sep 21, 2019
    Posts:
    1
    I'm not sure why, but even when I disable compression in player settings it still doesn't work for me.

    • The version of unity I am using is 2020.1.2f1
    • File is zip and includes the index.html, Build and TemplateData folder
    • Build and run loads absolutely fine
    • Tried it on another device
    • I am trying to post my game on unity connect
     
    Pawciu likes this.
  26. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    This may be a bug with Unity Connect. Does the browser console log mention anything relevant?
     
  27. Eden_Shazar

    Eden_Shazar

    Joined:
    Oct 19, 2018
    Posts:
    1
    This worked in my case:

    In my case, my non-development WebGL build, built using Unity 2020.1.7f1, was getting stuck at 90% when loading in Firefox 81.0.1 (32-bit) and didn't seem to budge even after a few minutes. The scene is very small, and reaching 90% was nearly instant, indicating (from what I've read here) that the assets were very quick to load; the entire build folder is about 12MB. I tried building (again, non-development) with Project Settings -> Player -> Publishing Settings -> Compression Format set to Gzip, and again with Brotli compression, in both cases with Decompression Fallback unchecked - both these builds did not load past 90%. Building again with Gzip compression and Decompression Fallback checked seems to have solved the problem, and the game now loads fully and quickly
     
  28. dongzhehao2002

    dongzhehao2002

    Joined:
    Oct 16, 2020
    Posts:
    1
    thank you
     
  29. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    so same issue here - upgraded to 2020 from 2019.4.12f1 to see if i could fix issues with webgl and memory going to 5 gigs (when its around 700M tops compared to standalone(standalone being higher res sprites and all too) anyways upgraded and stuck 90% - disabled compression - and loaded into my scene - seems a bit buggy - trying to do the compression -GZIP - and decompression failback checked this time as it was unchecked previously when i had compression enabled. did not bother trying the other compression option
     
  30. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    The difference between 2019.4 and 2020.1 is that in 2020.1 the decompression fallback is disabled by default, whereas it was enabled by default in 2019.4 and older.

    The reason that it is now disabled by default is that we are planning to remove it - it is a bad feature that directs uses to deploying suboptimally performing hosting solutions.

    We are improving the startup time error messaging in web builds so that the web builds point out in more detail when web server configuration is incorrect.
     
  31. Donausaurus

    Donausaurus

    Joined:
    Oct 5, 2020
    Posts:
    1
    Thanks so much Bro! That worked for me as well!
     
  32. MidniteOil

    MidniteOil

    Joined:
    Sep 25, 2019
    Posts:
    345
    Where can you set the max texture limit? Is this applicable for 2D games?
     
  33. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    100% works with 2020.2.x. :D
    100% still not fixed by default in 2020.2.x. :eek:
     
  34. Adjaar7

    Adjaar7

    Joined:
    Jan 6, 2020
    Posts:
    22
    I have tried all of these and nothing works! I am so mad I just want to share my game with my friends! Using Unity 2020.2.1f

    If I click build and run, it will open up in Edge normally, and the build file runs perfectly. If I click the Index.html file, the progress bar won't begin to move. If I put it in my github repository and use it with gitpages then it will stop at 90%, and nothing fixes it.

    I want to scream, Unity is making me very angry these days
     
  35. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Do you mean locally using Windows?
     
  36. Cenda

    Cenda

    Joined:
    Jun 3, 2010
    Posts:
    66
    Any new tip? I tried everything from this thread, but still stuck in 90%. (Unity 2020.2.1f1)
     
  37. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    The reason that this is not "fixed" is likely because the issue is with the configuration of the web server used to host the page, not with Unity.

    The real issue with Unity in current 2020.1 and 2020.2 that we have is that they unfortunately do not present a better error message to point the user to configuring their servers when server configuration is not enabled for precompressed files. Old Unity versions before 2020.1 would silently do software decompression, which worked, but gave users bad loading times without a way for them to realize they were getting suboptimal performance.

    For 2021.1 and newer, there should be a better error message that identifies when the remote server is misconfigured, and offers appropriate tips to proceed (either configure compression on the server; or enable the Compression Fallback and take that performance hit if remote server cannot be configured)

    The relevant documentation page is at https://docs.unity3d.com/Manual/webgl-deploying.html . Let us know if there are any omissions that we should improve.

    Also the issue that @Adjaar7 has is similar: web browsers do not allow opening web sites (that consists of more than one .html file, like Unity does) just with clicking on the file (running via file:// URL). One needs to have a web server to host the files. Unity 2021.1 and newer have also improved error messaging on this behalf to point the user to the root issue, rather than silently failing like that.

    If you are dealing with a cryptic "it just gets stuck at startup" issue, my recommendation is to
    - install Unity 2021.1.0b5, export an empty WebGL project with it, and try running that in your web host configuration. It should be explicitly vocal about web server errors, guiding you better as to what needs fixing on the server (if anything)
    - if it still silently hangs and does not load, there is one known bug with enabling Data Caching and running in Incognito/Private Browsing Mode. See this thread for more information and a local workaround: https://forum.unity.com/threads/uni...dexeddb-database-could-not-be-opened.1047761/ . If you disable Data Caching, or try running outside Private Browsing Mode, that should avoid this issue.
    - if it still silently hangs and does not offer any diagnostics information, then it is an Unity bug. We want to weed out all sources of silent startup errors. Please report it as an issue to Unity, but only after you have first tried the above two methods.
     
  38. Mopjoyovans

    Mopjoyovans

    Joined:
    Sep 18, 2020
    Posts:
    1
    I ran into this same problem on my itch upload, but found I had been missing an important option on the itch.io uploader.
    All I needed to do was check "This file will be played in the browser" on my uploaded zip.

    upload_2021-3-28_14-33-28.png
     
  39. MaazBaig

    MaazBaig

    Joined:
    May 17, 2013
    Posts:
    38
    We are having a very similar issue as to getting stuck at 90%

    But in our case, removing compression doesn't help us.

    It seems like all the files are there correctly but it doesn't seem to wanna download the .wasm file.
    We presume this is because Unity Engine isn't initializing and the build isn't running.

    We also assume this has something to do with our configurations on our project because if we try to load an empty scene on a new project it works fine. We tried to match all the build settings from the new project to our project but it doesn't help. Even to build out an empty scene.

    We are trying on Unity 2020.3.9f1

    We seem to be running out of options to try, Is there anything else we can try?
     
  40. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    What does the web browser DevTools Console tab show? How about the Network tab, does that download all the needed files? If the issue occurs on hosting an empty project, can you give 2021.1 or 2021.2 alpha a try, those are able to show some more diagnostics around startup failures.
     
  41. MaazBaig

    MaazBaig

    Joined:
    May 17, 2013
    Posts:
    38
    "What does the web browser DevTools Console tab show"
    The Console tab shows no errors. It just shows the progress which comes from the Unity loader, which gets stuck at 90%

    "NetworkTab"
    Shows it download all the correct files, EXCEPT the .wasm.br


    This issue DOESNT happen on an empty project. Only happens to our project.
    Building out to 2021, doesn't give us any extra logs or information either.
     
  42. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Do the files with suffix .br have the HTTP Response header field "Content-Encoding: br" set on them?

    If so, would you be able to a) host the build live somewhere to debug, and b) send a zip of the same files over to me for local testing? I have been under the impression that all "gets mysteriously stuck" issues would have been resolved by 2021.1 with explicit error messages, but looks like that might not be the case here.
     
  43. MaazBaig

    MaazBaig

    Joined:
    May 17, 2013
    Posts:
    38
    Do the files with suffix .br have the HTTP Response header field "Content-Encoding: br" set on them?
    Yes

    a) Yeah, we've been trying with both s3-hosted (both compressed & uncompressed) builds as well as local (uncompressed) builds.

    b) I sent you the Zipped file privately. Please let me know anything else you need.
     
  44. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Thanks. Taking a look at the build, I do not see any fault with it. The build runs fine for me locally.

    I am using the developer web server emrun (from https://raw.githubusercontent.com/emscripten-core/emscripten/main/emrun.py ) to locally test, by running this command in the unzipped directory of the build:

    python3 emrun.py --no_browser --port 8001 .

    and then navigating a browser to http://localhost:8001/ . That does load up without issues. Do you have an online link to the hosting where it does not work?
     
  45. MaazBaig

    MaazBaig

    Joined:
    May 17, 2013
    Posts:
    38
    Interesting that it runs fine for you.. will be curious to see if the hosted build also works.

    We've found that we can only run uncompressed builds locally.. compressed builds fail due to not being able to parse the brotli files. Perhaps there's some configuration we're missing? We CAN load the compressed builds when they come from our hosted storage, though. I will DM you the s3 links for this same build (which we've tried without success).

    If you are able to run those then at least that would clarify that we are doing something wrong the configurations.
     
  46. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    This is caused by missing the "Content-Encoding: br" HTTP Response header in the web server configuration. See
    - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
    - https://en.wikipedia.org/wiki/Brotli
    - https://docs.unity3d.com/Manual/webgl-deploying.html
    - https://docs.unity3d.com/Manual/webgl-server-configuration-code-samples.html
     
  47. MaazBaig

    MaazBaig

    Joined:
    May 17, 2013
    Posts:
    38
    Sorry for the confusion. To clarify - we already have the content-encoding headers set. I just meant that when we try to run any given build locally, it must be uncompressed. We cannot run compressed builds locally no matter what. This, in the grand scheme of things, isn't really a problem since we can just easily upload the compressed build to s3 to test it.

    Setting the headers was the first problem we had to solve to get the builds to even download properly. Now they download without errors but the build just isn't running (and the .wasm.br file is never downloading as seen above, presumably because the build isn't running)

    Were you able to run our hosted build?
     
  48. MaazBaig

    MaazBaig

    Joined:
    May 17, 2013
    Posts:
    38
    Also, we tried these exact steps and ran into an error that I believe stems from the fact that it's failing to parse/run the .br files. This is the exact same problem that I am referring to here:

    Here's the error, which we see in the browser console:
     

    Attached Files:

  49. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
  50. MaazBaig

    MaazBaig

    Joined:
    May 17, 2013
    Posts:
    38
    Thanks, that does resolve the error, but the build (this is the exact same build I sent you) still isn't running for me. There are no console errors, and all files except for the .wasm are being downloaded. Nothing happens for some reason..

    Here's a screenshot of the network tab:
     

    Attached Files: