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 How can I avoid loading entire StreamingAssets on start in webGL?

Discussion in 'Editor & General Support' started by Nadoc_NewLedge, May 20, 2021.

  1. Nadoc_NewLedge

    Nadoc_NewLedge

    Joined:
    Nov 26, 2020
    Posts:
    19
    I have few Unity WebGL projects which load very slowly. (stored on Amazon S3 cloud) testing revealed that all the project including the entire content of StreamingAssets is loaded on start before the game begins.

    How can I make the game NOT to load from streamingAssets unless the asset is called to play or a coded command is given?
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    What if instead of using StreamingAssets - you stored those assets separately on S3 and download them on demand with UnityWebRequest?
     
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,907
    I don't do WebGL, but I will assume Addressables work on it, so you can load whatever you want on-demand. It is made for this specific purpose. It's not StreamingAssets though.
     
    Joe-Censored and PraetorBlue like this.
  4. Nadoc_NewLedge

    Nadoc_NewLedge

    Joined:
    Nov 26, 2020
    Posts:
    19
    possible, moust to the AVPro urlrather than a sreamingassets path
    but won't it make the video lag on loading? or should i just make the download and preperation beforehand?
     
  5. Nadoc_NewLedge

    Nadoc_NewLedge

    Joined:
    Nov 26, 2020
    Posts:
    19
    that's what I did, only that I assigned the absolute URL rather than StreamingAssets.
    thank you
     
    PraetorBlue likes this.