make a update instruction work only one time 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;
}
}