- Home /
Question by
arieleibovich86 · Jun 10, 2016 at 09:06 PM ·
ontriggerenterambient lightambient
Change ambient Intensity on Trigger Enter
Hi everyone,
I'm trying to build a scene where ambient Intensity is '0' at first - to have everything kind of Black and white. After a while - the player picks an object that should set the intensity to 1.
Something like this basically (its not the entire code, but the jest of it..):
void Awake(){
RenderSettings.ambientIntensity = 0;
}
void OnTriggerEnter(Collider other)
{ RenderSettings.ambientIntensity = 1;
}
Now when I start - the intensity is indeed 0. But when the trigger is on - the intensity doesn't revert back to 1. (though through - "Debug.Log("ambientIntensity") - I can see its 1..)
Any ideas? might be that ambientIntensity can't be modified in game, only once at game start?
Thanks!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612082641im_/https://answers.unity.com/themes/thub/images/avi.jpg)