Anything like run once?

Is there any function or something that will run only once even if it's inside update?

1 Answer

1
var ranOnce : bool = false;
function Update()
{
    if (!ranOnce)
    {
        ranOnce = true;
        // code to run once here...
    }
}

Thank you. Worked for me.