Search Unity

Resolved URP build does not work

Discussion in 'Scripting' started by int04, Feb 12, 2024.

  1. int04

    int04

    Joined:
    Feb 12, 2024
    Posts:
    7
    Update:
    The problem is caused by the Matarial class.
    It seems that, in the Editor, when adding a new Object (even from code), the system will automatically select Metarial as Sprite-lit-default (an original black layer of URP).
    However, when deploying to the application when creating a new gameObject using the Metarial script file, it will not be automatically set to Sprite-lit-default.
    So, I cloned the original Metarial from the URP packages, then pasted it into the Resources section. When creating a new gameobject, point to this Metarial.
    As a result, the problem was resolved.
    Thanks for watching.

    Hi everybody,

    I am building a URP (Universal Render Pipeline Asset) system for my project.

    This works fine for me in the Editor, as shown below:
    upload_2024-2-12_21-21-5.png

    But when I build webGL, the window appears like this:

    upload_2024-2-12_21-22-7.png

    Have I configured something wrong, or haven't selected any part yet? I use Unity 2023.

    If anyone has the answer, or has encountered this situation, can you give me a solution?

    Wish everyone have a good day.

    Thanks !
     
    Last edited: Feb 12, 2024
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,048
    Check logs, say which exact Unity version is used, is it just WebGL or all platforms, does the editor use the same quality tier as WebGL?
     
  3. int04

    int04

    Joined:
    Feb 12, 2024
    Posts:
    7
    I used Unity v 2023.2.8f1, platforms I tested: window, WebGL
    All are displayed as pictured. At the same time, I turned on dev mode and didn't see any notifications on the screen.

    Update: The editor appears as image (1) above my post. The remaining platforms are displayed as photo (2) above the article.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,048
    Okay, if a standalone Windows build has the same issue, its an issue with the build in general. Can you send a screenshot of the quality settings in Project settings?
     
  5. int04

    int04

    Joined:
    Feb 12, 2024
    Posts:
    7
    Yes:
    upload_2024-2-12_21-41-58.png
    upload_2024-2-12_21-42-26.png upload_2024-2-12_21-42-47.png
    upload_2024-2-12_21-42-39.png

    View attachment 1370327
    View attachment 1370330
     
    Last edited: Feb 12, 2024
  6. int04

    int04

    Joined:
    Feb 12, 2024
    Posts:
    7
    Quality setting:
    upload_2024-2-12_21-50-38.png
    upload_2024-2-12_21-50-46.png
     
  7. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,048
    Delete all quality tiers except the one you need. You did not set an URP asset for all.
    Does that help?
     
  8. int04

    int04

    Joined:
    Feb 12, 2024
    Posts:
    7
    I found the cause:
    The problem is caused by the Matarial class.
    It seems that, in the Editor, when adding a new Object (even from code), the system will automatically select Metarial as Sprite-lit-default (an original black layer of URP).
    However, when deploying to the application when creating a new gameObject using the Metarial script file, it will not be automatically set to Sprite-lit-default.
    So, I cloned the original Metarial from the URP packages, then pasted it into the Resources section. When creating a new gameobject, point to this Metarial.
    As a result, the problem was resolved.
    Thanks for watching.