It may be simplest to just check the flag every tick if once the flag is true they it really is something that needs to be done in tick.
But, if it’s something that doesn’t need to be done every tick once the flag is true then it would be better to use a timer. You can set a timer to check if the condition is true every x time, if it is, then it can do the operation.
Quick question. If I have a function that needs a tick, but the function only needs to be executed under specific conditions, do I leave a boolean check running on the tick at all times, or is there a better way to do this?
Any insight is appreciated. Thanks.
Edit: To be clear, the boolean itself doesn’t need to be checked every tick, but once it’s true, the function will need the tick.