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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Light 2D not behaving properly with URP

Discussion in 'Universal Render Pipeline' started by transgwenderproud, Apr 28, 2021.

  1. transgwenderproud

    transgwenderproud

    Joined:
    May 25, 2020
    Posts:
    10
    Hi there, I've been having difficulties with Light 2D in Unity 2019.4.22f1. I've been trying to implement shadows into my scene to illuminate only some portions of the sprite. However, I can't get any partial lighting going with my sprites.

    upload_2021-4-27_18-41-30.png

    For some reason, when the Light 2D object is on screen, every single sprite is illuminated, but when it's offscreen, nothing at all is illuminated.

    upload_2021-4-27_18-42-4.png

    It doesn't matter the distance, as long as its off screen, nothing illuminates, and if its on screen at all, everything illuminates. This occurs in gameplay too. I've had no luck figuring out why this might be occurring, or what could be causing it. None of the properties of the objects change it either.

    upload_2021-4-27_18-43-49.png
    The material provided to the sprites

    upload_2021-4-27_18-44-18.png
    The UniversalRenderPipelineAsset, with the 2D renderer data set as default (the other one is there for non-2d scenes).
     
  2. transgwenderproud

    transgwenderproud

    Joined:
    May 25, 2020
    Posts:
    10
    Figured it out, there was a Target Sorting Layers variables that I didn't realize existed. Whoops ahaha. Changed it, and it all started working.