Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question is it possible for content in WebGL build not to be downloaded until it is needed on a scene

Discussion in 'WebGL' started by MarkMaa, Jun 25, 2023.

  1. MarkMaa

    MarkMaa

    Joined:
    Jan 20, 2020
    Posts:
    32
    So the end user will download from a server a 5mb scene at the first launch with all scene sprites, scripts, etc, but I have like 50 other textures 1mb each, and they are not needed on the scene for now, so they need to be downloaded later by request,1 by 1.

    There's the "Reduce load times with AssetBundles" page in the unity docs, but I didn't understand if the all content (the entire .wasm & .data files) will be downloaded from a server at the first game launch, or only the needed content

    Is it possible to do in unity without using WebRequest-s?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    You can use Asset Bundles or Adressables to load resources on demand.
     
  3. MarkMaa

    MarkMaa

    Joined:
    Jan 20, 2020
    Posts:
    32
    I tried to use Addressables, but all content is DOWNLOADED ON DISK from the server before it is needed (textures were marked as addressables and addressables groups were built before WebGL build)