- Home /
Spotlight on 2D infinite scrolling is blinking
Hello, I'm beginning with Unity, i'm having some troubles with a simple side scroller, and I cannot find the answer anywhere else. I created a spriteRenderer, gave it the Sprite/Diffuse material, and wrote a script to do a basic scrolling: when my transform reaches a given point, I Instantiate a new sprite next to it, so the scrolling can continue indefinitely.
The scrolling works fluently, but I wanted to add a fixed spotlight that would enlight the center of the road (The sprite I'm using for the scrolling). However, when the road is scrolling, the light won't stop blinking everytime my sprite changes. Here's a gif of what I'm getting.
I would like the part of the road right under the sun to be always enlighten, but it blinks, and the light follows the road scrolling.
EDIT:
By changing the spotlight to a pointlight, the blinking stopped. But the light keeps on following my sprite, even if the pointlight is immobile.
Any idea on how I can fix that ?
Thanks
I found a fix my changing the Rendering path of my Camera to "Graphics Settings" ins$$anonymous$$d of "Legacy Vertex Lit" Now it works fine!
Your answer
Follow this Question
Related Questions
Sun coordination with Skybox 2 Answers
When setting a transform size with attached SpriteRenderer, why is this not the actual pixel size? 2 Answers
How to let Lights effect a SpriteShape 2 Answers
Need help with Flashlight Script 1 Answer
Origin does not reset to 0,0,0, light component adds improperly 1 Answer