Random Spawn Time
charliehgreen
ArizonaMember Posts: 233
Hello,
So I'm having issue where I can't get enemies to spawn at a random time.
For example. I have the rule set to:
Every random(1,5) seconds
__Spawn Actor
But once I'm in the game, the enemy is being spawned every 5 seconds.
I would think from this code, he would spawn randomly every 1 - 5 seconds.
Correct? Guess not
Code Below:
So I'm having issue where I can't get enemies to spawn at a random time.
For example. I have the rule set to:
Every random(1,5) seconds
__Spawn Actor
But once I'm in the game, the enemy is being spawned every 5 seconds.
I would think from this code, he would spawn randomly every 1 - 5 seconds.
Correct? Guess not
Code Below:
Comments
this was posted to my thread by @ericzingeler for making every spawn actor his own.
my example was, spawn an actor...that actor is controled by player. then when that actor collides, spawn a new actor and the play now controls that one.
so @ericzingler recommended sorry if this is way off topic, i am very new to this but try and give back anyways because theres a lot of helpful people here.
then randomize the rows. its the same thing and bit more work but since ur timer isnt working.
btw i had a timer set up once that kept messing up on me. once i figured another way. it worked out perfect
Hi @charliehgreen
It used to be that a random in a Timer set to Every only registered once but then I thought that had been fixed... so it seems that's wrong...
So, you have to keep the random seconds outside of the Timer, to be put into an attribute to use, and not have the Timer set to Every - just to After - then set up a loop mechanism with a boolean.
Here's a little test to show you what I mean (btw, I made the attributes as game ones, just make yours scene ones if you want.)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I'm going to test @gyroscope sample.
Thanks again
i think all you need to do is just change it so the timer says after, insert a random function and choose your time frame, not sure if thats whats already been said
Good work @sarifluca .
But this post was from 3 years ago so GS may not have had the same functionality and some of these users probably don't exist anymore... Just remember that when you're looking for tips, make sure theyre recent as a lot has changed!
This is still relevant now.
If you use the timer on "every" with a random amount. It only calculates the random once. Then uses that number forever, not very random at all.
Thankyou gyroscope!