Search Unity

Lens Flare disappears at edge of screen?

Discussion in 'General Graphics' started by _eternal, Apr 6, 2016.

  1. _eternal

    _eternal

    Joined:
    Nov 25, 2014
    Posts:
    304
    I'm using a Lens Flare component to represent the sun in a 2D game. When the sun rotates onto or off of the screen, I noticed that the flare effect disappears. Basically, once the center of the sprite is obstructed by the edge of the frame, the flare vanishes and only the sprite remains.

    Is there a way to make the flare stay visible even if it's obstructed? Or if it's not supposed to work that way, can I still create something that looks like the sun using Unity lighting rather than a sprite? The current sprite is just a circle, so without the flare it doesn't look like anything.
     
  2. _eternal

    _eternal

    Joined:
    Nov 25, 2014
    Posts:
    304
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    You'd have to write your own flare implementation, or you can get one of the flare systems on the asset store. The default Unity flares do not have a way to not blink out of existence as soon as they're off screen or occluded by a physics shape apart from the fade speed setting on the flare, but that doesn't really prevent the issue you're having.