I want to generate an alert at a random time after an event has happened.
I'm generating a random number but am unsure how I use that in the time with the appended f as in the example below:
Anyone know how I should do this?Code:timer.Once(3f, () => { Puts("Hello world!") });
Thanks.
Random timer delay in c#
Discussion in 'Rust Development' started by Rebajas, Jan 26, 2017.
-
Code:
timer.Once(UnityEngine.Random.Range(1f, 3f), () => { //code });
Code:var rng = UnityEngine.Random.Range(1f, 3f); timer.Once(rng, () => { //code });
-
Wulf Community Admin
-
-
Yeah - it is just once per event. So this should be perfecto
Thanks!