Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How do I suppress unnecessary errors from URP?

Discussion in 'Universal Render Pipeline' started by Avalin, Sep 13, 2020.

  1. Avalin


    Oct 12, 2018
    EDIT: Maybe suppressing errors is not the ideal solution, I am open to suggestions

    I get this error 3x:
    Code (CSharp):
    1. More than one global light on layer Background for light blend style index 0
    2. UnityEngine.Experimental.Rendering.Universal.Light2D:OnEnable() (at Library/PackageCache/com.unity.render-pipelines.universal@8.2.0/Runtime/2D/Light2D.cs:451)
    Thing is, I have a DDOL object that has and controls the globalLight for every scene I have.
    Due to this, every scene will be pitch-black in the Unity Editor unless I add a GlobalLight to them when I want to edit anything.

    To solve this, I have made an object tagged as EditorOnly with a GlobalLight so that I can still see my scene, but should not be instantiated on built. Furthermore made a script to deactivate this object on Awake, as the DDOL will take over, but still not quick enough to not ship me the 3 error messages. Is there a better way to deal with this and rid of the errors?
  2. Acissathar


    Jun 24, 2011
    I might be misunderstanding your setup, but I think if you click the scene lighting toggle it should do a "base" lighting so you can edit and you won't need that editor only light object. When it's on, it'll use your scene light, and when off it (should) use a fake light attached to the scene camera (this is scene editor only)