Spawn actor randomly doesn't work unless specific number range is used

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

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2016

    @mcholman@yahoo.com said:
    Is that just a problem with GS?

    No, it will be an issue with your code.

    Can we take a look at your code ?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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.

Sign In or Register to comment.