Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Loop a 'Start' function?

$
0
0
Hi, here's the code: ---------- #pragma strict var animator : Animator; var minWait = 5.0; var maxWait = 20.0; function Start () { animator = GetComponent("Animator"); yield (WaitForSeconds(Random.Range(minWait, maxWait))); if (true) { animator.SetInteger("WaitAnimPick", Random.RandomRange(1, 3.5)); yield; } animator.SetInteger("WaitAnimPick", 0); } ---------- This code functions only once in the game. I'd like it to function again and again, over and over every 5 - 20 seconds. Can someone help? Thanks.

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>