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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug Materials don't load properly when using "Use Existing Build" play mode script

Discussion in 'Addressables' started by tomkail2, Sep 6, 2021.

  1. tomkail2

    tomkail2

    Joined:
    Jul 22, 2011
    Posts:
    25
    Hi there! We're finding that "Use Existing Build" isn't loading materials properly on WebGL.
    The scene shown here ("Home") is hosted on a server and loaded via Addressables - but the sprite materials (as well as a particle system and another custom shader) are all showing with the default pink "broken shader" color.

    You'll notice that there's a warning stating "Material does not have a _MainTex texture property" and some errors (Assertion failed on expression: 'request.key.guid.IsValid()') spamming the log (these only show when the material inspector is expanded).

    These errors can be fixed by removing and re-adding the material, or changing the shader back and forth - but obviously this means it's no longer using the downloaded material!

    Should we assume this is covered by the warning "Asset bundles built with build target WebGL may not be compatible with running in the Editor."?

    upload_2021-9-6_9-4-39.png
     
    Last edited: Sep 6, 2021
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,732
  3. zap7

    zap7

    Joined:
    Oct 29, 2017
    Posts:
    2
    Was this ever resolved?? +1
     
  4. unity_krista

    unity_krista

    Unity Technologies

    Joined:
    Apr 28, 2020
    Posts:
    40
    The materials being pink is expected for running in Editor for non-Standalone platforms with Addressables. This is because different platforms have their own way of compiling those shaders. Does it load correctly in browser or on console?
     
    KamilDA likes this.
  5. KamilDA

    KamilDA

    Joined:
    May 21, 2020
    Posts:
    278
    After banging my head on this issue for a long time may I suggest you please add this to the documentation.

    For examples, loading addressable scenes in WebGL + URP is basically impossible in this mode.