How can i add a min-max value to this?
Right now it fades all the way to black and i need to control it somehow.
Any ideas?
if (timer < 1)
lightToDim02.intensity -= Time.deltaTime * 0.2;
How can i add a min-max value to this?
Right now it fades all the way to black and i need to control it somehow.
Any ideas?
if (timer < 1)
lightToDim02.intensity -= Time.deltaTime * 0.2;
Change it to something like this:
lightToDim02.intensity = Mathf.Clamp( lightToDim02.intensity - Time.deltaTime * 0.2f, minValue, maxValue );
Also it is a good idea to turn the component off (or just this animation) when you reach minValue.