Spawn actor randomly doesn't work unless specific number range is used
mcholman@yahoo.com
Member, PRO Posts: 6
Hi. I'm using the timer to spawn an actor at random intervals using the random function. However, if I use a minimum less than 3 or a maximum greater than 5, it doesn't spawn anything. It works fine within that specific range, though. Is that just a problem with GS?
Comments
No, it will be an issue with your code.
Can we take a look at your code ?
Yes, we'll need to see how you set up your rule and timer but one thing to know is that using a random function inside of an Every timer doesn't change the value each cycle of the timer. So for example, Timer every random(6,10) might choose 7 seconds the first time through and then will repeat every 7 seconds after that.
Here's a way to get around that: http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User