how to run a function only once in update unity code example
Example: how to call something once in update
bool isDone = false;
void Update() {
if (!isDone) {
// put your code that runs once here
isDone = true;
}
}
bool isDone = false;
void Update() {
if (!isDone) {
// put your code that runs once here
isDone = true;
}
}