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

Bug Unity Freeform 2D Light Randomly Glitching (URP)

Discussion in '2D' started by CodeRadStudio, Jul 18, 2023.

  1. CodeRadStudio

    CodeRadStudio

    Joined:
    Feb 14, 2015
    Posts:
    4
    I have a sword prefab, that has a light2d freeform light attached. I instanciate the sword and sometimes the light is glitched like on the picture top right. This issue was not happening on 2020.3.26f1. I moved to 2022.2.18f1 and it started to happen. Its quite common about 20% of time when I spawn the prefab.
    I suspect its something to do with such tiny values between the light points, check attached image, edit shapes values.
    This still happens without light flicker script so there is no scripts that affects this light. So I assume it's Unity engine issue.

    Is this issue solved on later version of the unity? Is there any way to fix it in my current version?

    UnityLight2DIssue.png
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Always worth trying the latest LTS.
    Can you check if this also happens in a new 2D urp project?
    Is it just in editor or also in a build?
     
  3. CodeRadStudio

    CodeRadStudio

    Joined:
    Feb 14, 2015
    Posts:
    4
    Hey thanks for answering,

    - Ive installed latest LTS 2022.3.5f1 and it's still happening
    - Its happening in editor when I move the nodes randomly and its happening in the build quite often.
    - I have tried it running on empty project, it was not happening untill I started moving the edit shapes points close and closer togather.

    Looks like my project scale is small and thats what is causing this bug.

    The point positions on edit shape are too close to eachother which causes the bug. So my current solution for a fix is to change Scale the light down from 1 to 0.1. Then edit shapes and move points around again. Now they will be further from eachother and bug will no longer happen. Unity please fix.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Make a bug report in the editor by clicking Help - Submit a bug report
    This way it will get to the team
     
  5. CodeRadStudio

    CodeRadStudio

    Joined:
    Feb 14, 2015
    Posts:
    4
    Reported it. Looks like they are looking into it.
     
    DevDunk likes this.