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. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Lens flare, sun and its positions in space

Discussion in 'General Graphics' started by Karwoch, Jul 24, 2015.

  1. Karwoch

    Karwoch

    Joined:
    Sep 16, 2014
    Posts:
    111
    Hello, I`m trying to implement a sun with lens flare. I`ve created directional light, in its child I`ve put gameobject with sun image wich always looks at main camera, then in camera code I position sun at camera position and than move it backward about 1000 units. Everything is fine - sun looks like it should, but when I put lens flare on directional light - it appears in different position than sun image really is. And it really would look cool if main lens flare spot would be at sun image position.

    Is there a way to do this? Rotating directional light seems to move lens flare position - so there must be a way to count it.

    Best regards to whole Unity community.
     
  2. DarkX

    DarkX

    Joined:
    Apr 6, 2014
    Posts:
    42
    in the lensflare,

    set the variable,
    directional - true

    that will work
     
    Karwoch likes this.
  3. Karwoch

    Karwoch

    Joined:
    Sep 16, 2014
    Posts:
    111
    Thank You! I didn`t get info about Your answer, but this is exacly what I needed, to many things :)