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. Dismiss Notice

Question 2D lighting is in the wrong position in Game Mode

Discussion in '2D' started by Quardis, Apr 3, 2021.

  1. Quardis

    Quardis

    Joined:
    Apr 16, 2016
    Posts:
    2
    I have been working on a 2D platformer game that relies on URP's 2D lighting system. I just upgraded my Unity to 2021.1 today and for some reason, all the point light components seem to be giving light in the wrong positions in Game Mode. However, they work perfectly fine in Scene View. To give an example:



    The orange light from the portal is at the bottom of the screen when it should have been right on the portal.

    The correct version in Scene View looks like this:


    See how the light is actually originating from the portal?
    Did anyone else found that their 2D lights are acting weird since the last update? Do you know why this might be happening?

    Thanks a lot! :D
     
  2. Sickg

    Sickg

    Joined:
    Apr 6, 2020
    Posts:
    2
    Hi
    i have same problem...
     
  3. wacasce

    wacasce

    Joined:
    Sep 14, 2017
    Posts:
    4
    Same
    Same problem as well
     
  4. qwv

    qwv

    Joined:
    Jan 13, 2020
    Posts:
    1
    Same here. Ended up checking "Post Processing" on the main camera, then it worked.
     
    Last edited: Jun 14, 2021
  5. Sickg

    Sickg

    Joined:
    Apr 6, 2020
    Posts:
    2
    fix.png

    I change Render Scale from 1 to this 1.06 or more and its working now...
     
  6. CattivoAlex

    CattivoAlex

    Joined:
    Jun 9, 2020
    Posts:
    2
    Hi,
    I have the same problem. The problem is only when you use a Camera Stack. With other camera the lights works well.
    The problem is not only the position but olso the rotation, if you use only spot light you can think that is only the position but try also to use "freeform".

    someone help me please :)

    Unity 2021.2.0b10 URP 12
     
    Billythekidzz1 and Tastie_Games like this.
  7. CattivoAlex

    CattivoAlex

    Joined:
    Jun 9, 2020
    Posts:
    2
    Dear All,

    I tried to create the bug with version 2021.2.0f1 in an empty project:

    - 1 main camera
    - 1 camera stack
    - 1 sprite
    - 1 light 2d

    and you got the problem

    with the new release 2022.1.0a13 the problem with camera stack and light 2D is fixed also I tried upgrading my project and all works fine (all.... I need to test evrythink but the light works :) )
     
  8. bioticste

    bioticste

    Joined:
    Aug 11, 2014
    Posts:
    37
    I have the same problem in Unity 2021.2.8f1. I have a 2d spot light attached to my player, I just updated for 2021.1.11f1 in which the 2d lights were working fine. The 2D spot and sprite lights in the 2021.2.8f1 version are correct in the editor scene view when not playing . As soon as I click play the 2d lights seem to always be in the correct x position but are placed and move incorrectly on the Y axis this also happens when I build the project.

    It is really strange, I observe the transform positions of the child 2d spot lights and sprite lights and the position, rotations and scales do not change yet the child seems to be in completely different y positions than its parent. I'm going back to using 2021.1.11f1 until this is fixed.
     
    Ratgibnake likes this.
  9. Naomi-DevOps

    Naomi-DevOps

    Joined:
    Apr 14, 2021
    Posts:
    10
    this one helped me too, thnx a lot
     
  10. Staakman

    Staakman

    Joined:
    May 15, 2013
    Posts:
    10
    Unfortunately still happening in version 2021.3.4f1 when I use the camera stack!

    Some matrix manipulation goes wrong in the background I guess?

    in the below (crappy quality) video you can see the light jump when I enable the camera stack

     
    Last edited: Jul 5, 2022
  11. bioticste

    bioticste

    Joined:
    Aug 11, 2014
    Posts:
    37
    The same issue is still present in Unity 2021.3.7f1 LTS. That is pretty bad for an LTS version, the last known working version for me is 2021.1.28f1, all versions after this have the bug with URP, camera stacks and 2d lights. I'm just about to see if it is fixed in 2022.1.12f1, hopefully it is as this is a major set back for my game on all platforms.
     
    RemDust likes this.
  12. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    431
    Please keep us posted !
    I have the same issue and dont know which version I should aim for :/
     
    Miles2650 likes this.
  13. Lepisto3D

    Lepisto3D

    Joined:
    Oct 6, 2019
    Posts:
    27
    Miles2650 and RemDust like this.
  14. Miles2650

    Miles2650

    Joined:
    Feb 3, 2022
    Posts:
    1
    Ran into this problem today when attempting a camera stack for the first time. Quite frustrated and disappointed. Unity version 2021.3.16
     
  15. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    254
    Will look into this this week. I didn't realize this fix hadn't been backported.
     
    RemDust likes this.
  16. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    254
    Try this again with 2021.3.18. This seems to be working for me.
     
  17. LucasAssuncao

    LucasAssuncao

    Joined:
    Sep 12, 2022
    Posts:
    6
    Same problem with me, the only solution then is to change the version of unity? Currently my project is on version 2021.3.16f1
     
  18. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    254
    We can only fix bugs in new releases, so at the very least you need to install 2021.3.18. However, its likely that you could still use 2021.3.16 as the 2D URP code should be compatible. But I'd recommend using 2021.3.18 as there might be other bug fixes.