Answer the question
In order to leave comments, you need to log in
Unity (C#) - How to execute Invoke 1 time in Update?
You need to execute Invoke() once in Update. But since Update is updated every frame, the function is called every frame. Is it possible to implement this?
Answer the question
In order to leave comments, you need to log in
the most obvious .. that you do not need to do this in the update .. but on some kind of event.
otherwise, if you really need to, then usually they just set a boolean flag that the action has already been completed
void Update()
{
if(!once)
{
once = true;
//invoke here
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question