how to make code in update only run once 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;
}
}