button to random spawn

I am working on a project in the bge that allows me to push a button and then a random object appears. I got the button part done but not the part where it spawns in the random object.

Try this: get a random number in a property with Random actuator and according to this number spawn an object or another…

This could be done with logic bricks but it is a huge work if you have very much random objects

I think you may have misunderstood. I have a button in game. Like the portal buttons that you push to drop cubes. And I need it to do a random event.

So you can connect the pres button event with the random spawning as explained in the other thread ;).

In the other thread I asked for blocks to spawn on their own but now I need the button to spawn only 1 random object. EX: I press the button and text shows up that say green, then the next time I press it, it says red. But it randomly chooses the colors. Instead of automatically doing it.

oh! come on… you can connect method Monster explained to get what you are looking for.

Hello Goodolson;

You can use the next set-up to make appear a random object when you activate the button. And make it dissapear when another object appear. Just need to configure the logick bricks especified on the image on every obj.

Hope this helps.

zL


Thanks very much! :slight_smile: