- Home /
Anything like run once?
Is there any function or something that will run only once even if it's inside update?
Comment
Answer by loopyllama · Apr 17, 2011 at 07:48 PM
var ranOnce : bool = false;
function Update()
{
if (!ranOnce)
{
ranOnce = true;
// code to run once here...
}
}
Your answer
Follow this Question
Related Questions
coroutine spamming webserver which then stops replying 2 Answers
GUI position not updated on build & run 0 Answers
run code once every 10 second 1 Answer
Calling a function only once in Update 6 Answers
How to run a update function once 3 Answers