I'm trying to make a script for a camera flash as a lantern - I have it working except for the script. The camera is just a lantern with a spotlight, with its fade in and out set to 0, so its instant. Preferably I'd like to have the lantern switch itself off after 0.1 seconds of being turned on. I've being trying to use a script like this, but its not working as I would expect...
void OnStart()
{
if( !GetLanternActive()==true)
{
AddTimer("", 0.1, "LanternOff");
}
}
void LanternOff(string &in asTimer)
{
SetLanternDisabled(true);
AddTimer("", 5.0, "LanternOn");
}
void LanternOn(string &in asTimer)
{
if( !GetLanternActive()==false)
{
SetLanternDisabled(false);
}
}
I get the feeling it should be really simple, but I'm still terrible at scripting