Search Unity

Question 2D Lighting Will Not Work

Discussion in 'Universal Render Pipeline' started by anamaux, Sep 2, 2021.

  1. anamaux

    anamaux

    Joined:
    Mar 6, 2015
    Posts:
    20
    Hello, no matter what I do the 2D lighting will not work in my game. I am creating a Pipeline Asset (Forward Renderer) asset, attaching it to the Scriptable Render Pipeline Settings in Project Settings/Graphics, and then creating Pipeline Asset (2D Renderer) asset and attaching that to the Pipeline Asset (Forward Renderer).
    Any help would be greatly appreciated!
     
  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    How is it not working exactly? What do you see? You've added a Global Light 2D to your scene and...?

    Another thing that you typically have to do is change the Camera's Skybox to a solid color b/c skyboxes aren't supported in the 2D Renderer.
     
    Last edited: Sep 5, 2021
    orhanjet likes this.
  3. anamaux

    anamaux

    Joined:
    Mar 6, 2015
    Posts:
    20
    Thanks for the response Lo-renzo, the 2020.2.1 project, has the 2D light options greyed out when trying to create the asset. The 2021.1.18 project doesn't have those same choices, so they're not greyed out they just don't exist.
     
  4. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    You might want to double check you've followed all the creation steps. Maybe one is missing.


    You may also want to go into your Package Manager to ensure you have up-to-date versions of URP and such.
     
  5. anamaux

    anamaux

    Joined:
    Mar 6, 2015
    Posts:
    20
    Thanks Lo-renzo, I've followed all of the steps and am scratching my head as to why it isn't working. Do you know of any prerequisites to this? Are the any configurations that will automatically disable this?
     
  6. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    This may be easier. 2021.2 should have a 2D URP template project that sets itself up.

    Open Unity Hub.
    Download 2021.2.
    Go to New in the top right. Use the dropdown to select 2021.2.
    Select the "2D URP" template.
    Wait for new project to open and it should be ready to go.

    Alernatively pre 2021.2, you might take one of the 2D template projects, like Lost Crypt on the Asset Store, and delete everything except for the correctly set up settings.

    Between these options, that should guarantee a properly set up project.
     
  7. anamaux

    anamaux

    Joined:
    Mar 6, 2015
    Posts:
    20
    Awesome, I want to incorporate this into an existing project. Should I just package everything and import it into the new project? What have you found the best way to do this? I'm sorry if that's off topic but you seem very knowledgeable.