Is there any function or something that will run only once even if it's inside update?
1 Answer
1var ranOnce : bool = false;
function Update()
{
if (!ranOnce)
{
ranOnce = true;
// code to run once here...
}
}
Is there any function or something that will run only once even if it's inside update?
var ranOnce : bool = false;
function Update()
{
if (!ranOnce)
{
ranOnce = true;
// code to run once here...
}
}
Thank you. Worked for me.
– seb.vitczak