decreasing a light over time?

hey there,

i’m pretty new to unity and i’m trying to work out how to do something in particular;

i want to create an environment that the player must navigate, the player has a point light attached to them that decreases in intensity over time, colliding with another torch will restore the point light back to full intensity. if they run out of light then i want the game to reset…

is there anyway to do this?

thanks

Absolutely; the link below to the scripting guide is a pulsing example. In your case, instead of setting the intensity property in a sinusoidal manner, just Lerp from 1.0 to 0 over whatever time frame you need.