Random locating actor

I'm going to place a lot of actors to be "obstacle" in this game..
But i dont know how to place it randomly ?
I figured out if i place it manually then this game such a bored.. Then i need a randomly placing this obstacles..
Anybody knows the solution ?
But i dont know how to place it randomly ?
I figured out if i place it manually then this game such a bored.. Then i need a randomly placing this obstacles..
Anybody knows the solution ?
Comments
And the same for the Y if desired.
but if i want it more than 1 in the scene, how to do that?
do i have to put the same actor a lot in a scene?
If only a few are showing at the same time on the camera view, I'll try recycling the actors. This way, those who are off the view, can change his position to a new one (with 'Change attribute').
Obviously, you could use spawning, but the problem is that increases the RAM usage and the loading time.
If you explain the kind of game, I could be more precise
Hope it helps
Create an actor that will spawn the obstacles 'Generator', and drag it on the scene.
In this actor make a Change attribute 'HowMany' to random(min number of actors,max number of actors).
Inside this actor, also do the Spawning.And every time you spawn an obstacle Change att 'Howmany' to 'howmany-1'
You can make the Generator actor all screen tall and wide and make it invisible, and when the game starts the obstacles will appear in random locations and number.
I think this should work if the game isn't scrollable.
Hope it helps.
Make a rule in the Spawner that says, if "triggered", Spawn Actor at X location (random[minimum distance far away],[maximum distance]. Use the expression Random and it will make take the first number and the second number and randomized between them. Like in the X in the Spawn Actor box, Random(20,40) and it will be between 20 X pixels to 40 X pixels away from the spawn.