title: (Unity 3D) Change Lighting By Player Position (Vertical Position)
body: <p>A good example of this (Game also built using Unity) is a game like &quot;Getting Over It&quot;. The Games lighting itself (all objects and even background) becomes &quot;darker&quot; as the character climbs into the atmosphere. I am making a similar game where a character is climbing outside. I already have a gradient 2D background of the sky going from yellow to purple to dark blue etc giving the impression that the sky is getting darker whilst the character climbs higher. My question is, I have not found an efficient way to change the scenes lighting as the character climbs higher. The background obviously gets &quot;darker&quot; but all objects regardless of position are just as illuminated as the next no matter their position. The only way I've gotten around this is to change the &quot;suns&quot; position using a script and actually forcing it to set over time. The sun isnt even able to be seen (2D background blocking it). The issue is this is really performance ineffective and I am wondering if there is a better way of changing the lighting to become darker or just making the higher objects darker to give the illusion that the world is becoming darker as the character climbs (character also needs to become darker).</p>
  <p>Experience wise I have done pretty much everything but lighting. (Inverse also needs to happen as character can fall).</p>