Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Random spawning isn't working

Hi everyone! in my game I need to have 4 different actors spawn randomly. I watched a video online to help me get started with making it randomly spawn, and I did everything it says. However, when I preview, the same actors spawn over and over again, its not really random, and then it changes scene to my main menu scene. I have no idea why it keeps going back to the main menu scene, or why it wont spawn different actors. Also it doesn't give it time between each spawn, it just shoots out my actors until it changes the scene and then it stops altogether. Any help would be greatly appreciated! Thanks in advance!

Best Answer


  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO

    Hi, your Rules would be nice... we can see what's going wrong then.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain

  • LightningSoraLightningSora Posts: 3Member

    Alright, so for my rules...I made a game attribute called "random" and set it up with a timer that every 5 seconds it would choose a random number from 1 to 4. So its set as Timer every 5 seconds, change attribute game.random to any of my actors that are labeled 1 to 4. After that, I set 4 more rules but all of them are essentially the same. The rule has another timer that every few seconds, if the random number is 1, then it would spawn actor number 1, and if its equal to 2 it would spawn actor 2. And it does spawn the actors, but it spawns the same actors over and over in one round and then it just switches the game scene to my main menu scene. There is no rule to change scene so I don't know how its getting there.

  • LightningSoraLightningSora Posts: 3Member

    Thanks a lot! It worked perfectly. I know I'm late in checking this out, but it worked. Thank you!

Sign In or Register to comment.