- Home /
2D Lights Flicker when in motion, not always visible.
I have a perspective camera looking at a 2D scene, and a physics box in that 2D scene with a Point Light 2D attached. When the box is sitting still, the light isn't visible at all. When in motion the light will randomly flicker and be briefly visible before once again disappearing. This issue happens in both the editor and built versions of the game. Im running Unity 2020.3.15f1 which as far as I'm aware doesn't have any issues with 2D lights and perspective cameras. No post processing, only other script affecting the camera is on the main camera gameobject and it is the FMOD Studio Listener, which I've tested and it has no effect. Have update all materials in the project with the render pipeline updater to no avail.
Answer by jihadkhawaja · Jul 27, 2021 at 10:08 PM
hey there @Fonics,
Did you try to increase the z position of the light towards the camera?
I did, and the behavior doesn't change. I've actually realized whats happening is much stranger than I thought, its almost as if the light is on a grid and only when it moves to the next grid space it actually illu$$anonymous$$ates. I've got a video up that showcases whats going on, should be much better than my attempt at describing it. https://imgur.com/a/pAzwFu1
I just watched the video, try rendering the light as Important in the inspector if that didn't work would you $$anonymous$$d creating a new 2D project and place a 2D light and test it out. It might be something related to the Camera Occlusion culling.
I fixed it. I deleted all the URP assets and resetup the project with the new URP assets. It works now. I guess turning it off and on again was kind of the solution lol. Thanks for the help!