I am looking for a java script that will pick out a random number between 0 and 360 every 5 seconds.
I already have this:
yield WaitForSeconds(2);
randomDirection = Random.Range(0, 360);
Thanks for the help!
I am looking for a java script that will pick out a random number between 0 and 360 every 5 seconds.
I already have this:
yield WaitForSeconds(2);
randomDirection = Random.Range(0, 360);
Thanks for the help!
function Start () {
InvokeRepeating (“PickRandomNumber”, 5.0, 5.0);
}
function PickRandomNumber () {
// should be obvious from here
Just add a function Update, with an if statement, calling another function which sets pickNumber to true every 5 seconds.
Nevermind… I don’t have time to type an answer and Unity Answers won’t let me delete my answer. Sorry.