Call a Function at random time

Hi, like the title said I want to call a function at a random time but with a min-max of time, for example a random between 5-30.

Sorry for my bad english

Steps to success:

  • start a coroutine
  • choose randomly between 5 and 30
  • yield for that amount of WaitForSeconds()
  • do the function

If that’s not enough, try it one step at a time:

Imphenzia: How Did I Learn To Make Games:

Two steps to tutorials and / or example code:

  1. do them perfectly, to the letter (zero typos, including punctuation and capitalization)
  2. stop and understand each step to understand what is going on.

If you go past anything that you don’t understand, then you’re just mimicking what you saw without actually learning, essentially wasting your own time. It’s only two steps. Don’t skip either step.

Step #2 is particularly critical when learning.

If you are unwilling or unable to do Step #2, just ask someone else to do the whole game for you.