Hey everyone,
so I know that if you want to only run something once in Update() you would normally use a boolean within an if statement like so:
bool isDone = false;
void Update() {
if (!isDone) {
// code that runs once here
isDone = true;
}
}
If you have big scripts like me, it however becomes really messy at some point having plenty of different booleans that just serve as “checks” if or if not something has already been executed. I just thought to ask if there is any other way of doing this - although I guess there is not.
Thanks in advance!