Best way to create an event occurring at a random time?
Hello! I was wondering whether there's a best practice for making events that occur at a random time in unity. From what I've seen, a popular way to go about it is using Random.Range and using that value in conjunction with Time.time or system time to define a new random time. These solutions all make use of the update method to continuously check whether the current time has reached this new randomised time, and if it has, the event will occur.
My question: Is using the update method to constantly check the time expensive on performance? If so, is there a more recommended or more optimised way of doing this?
No, comparing every frame two float values won't impact performances.
Your answer
Follow this Question
Related Questions
How to stop getting duplicate numbers while using random.range 1 Answer
Increase over time, 0 Answers
Random Scenes Without Repetition 1 Answer
Pausing a Mathf.PingPong at the ends 0 Answers
Time.deltaTime and difference of Time.time not matching 0 Answers