Make a 'control' actor - this is just an actor that you use to control what happens in your level. Place it just off-screen so it doesn't show up when you play your game.
In this actor, put in a timer that says 'Every 5 seconds'
Then a spawn behaviour. You will be able to edit the X and Y of where you want the new actor to appear.
You'll notice a little 'e' next to the X and Y coordinates.
Click this.
You'll then have the attribute window open - at the bottom there's 'insert function'. Click on the button next to that and a drop down menu will appear.
From this, choose 'random'.
This will appear in the text window as random(min,max)
Replace 'min and max' with values. If, for example, you wanted stuff to appear at the top of the screen in landscape mode in random locations, your X value would be random(0,480), your y value would be 320.
This way, the actor will spawn in a random location between 0 (min) and 480 (max) on the screen.
Additionally, you can randomise the spawn time. Remember that timer 'every 5 seconds?' - click the little 'e' box again where you typed '5' originally.
Go to insert function again and pick 'random'.
Then insert the values. Let's say we want an actor to appear between 3 and 6 seconds. The values you'd put in would be random(3,6)
Comments
0,0 can be edited to waterer u want
Make a 'control' actor - this is just an actor that you use to control what happens in your level. Place it just off-screen so it doesn't show up when you play your game.
In this actor, put in a timer that says 'Every 5 seconds'
Then a spawn behaviour.
You will be able to edit the X and Y of where you want the new actor to appear.
You'll notice a little 'e' next to the X and Y coordinates.
Click this.
You'll then have the attribute window open - at the bottom there's 'insert function'. Click on the button next to that and a drop down menu will appear.
From this, choose 'random'.
This will appear in the text window as random(min,max)
Replace 'min and max' with values. If, for example, you wanted stuff to appear at the top of the screen in landscape mode in random locations, your X value would be random(0,480), your y value would be 320.
This way, the actor will spawn in a random location between 0 (min) and 480 (max) on the screen.
Additionally, you can randomise the spawn time. Remember that timer 'every 5 seconds?' - click the little 'e' box again where you typed '5' originally.
Go to insert function again and pick 'random'.
Then insert the values. Let's say we want an actor to appear between 3 and 6 seconds. The values you'd put in would be random(3,6)
Hope that helps!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io