[Solved] How to create random objects

May be make a variable “Random” !
On click trigger once- set value of “Random” to random in range of 1-5 ! Then if value of random =1 and no of obj 1 is <1 (if you want that object to spawn only once during the scene) → create obj 1. if 2 and no of obj2 <1 then create obj 2 …! And like this! I think this is what you wanted and hope this works!:relaxed:

1 Like

Thanks a loooooooooooooooooooot! I have solve the random spawn system but I didn’t understand this quout…can you tell me the action and condition names?

Thanks it was helpful.

Value of scene variable =…
No of objects on scene =…

1 Like

Bro sorry! I failed . Now I can create object Randomly. But Object (A & B) is not creating only once.
File link. Please help.

THE_GEM_TUTORIALS

Help Please!

1 Like

Send screenshot of the events

1 Like
1 Like

If you want something to happen only once, use trigger once

Do you want it to be created once per click (1)or once in the entire game/match(2)?
If you want to do (1) the put: Trigger once condition
If you want to do (2):
If the variable is 1 and you have to create obj 1:
Value of Scene variable is 1 &
No of *obj 1 * is <1
Trigger once---------->create obj 1

Note:This one will create no objects if you get variable 1 again and you already have obj 1 created before(you will have to put seperate events for that)
And if you dont want the objs to pile up on each other then just put a condition :The cursor or touch is on object (obj1,2…) and invert the condition

Hopefully this helped. :grin:

And I am sorry I dont have pc right now so I could not check the file you sent

1 Like

Hey Thanks …And sorry for becoming so dumb. I am having this problem When value variable is 1 again no object is created.I want what action should I use when Number of obj A & B is = 1 and Value of variable is 1 & 2.

Make the variable Random in range again!! Do that cycle continues till you get 3 or 4 or…

1 Like

I did that but sometime I click buttone but no object created.

Send screenshot of your event!
And do that event that i told you for every single object not just one!


You can Ignore the red area.
I have a object group named Random and a global variable named Random.

You can have the file here

https://we.tl/t-HZbTxuBo9j

I dont know what’s wrong ! Sorry but I think you should have got your result right if you did what I said! And again I am not on pc so I cant help much! Sorry

1 Like

Its ok finally I tryed youre solution for last time and it worked! Thank you soo much for your help and kindness.

1 Like

Btw what kind of game is it? Any pictures?

And here’s mine too! :grinning: If you feel like I helped you a lot :wink: Please help me too by checking out my game ! Its free. And online on itch (just a bit of advertising :grin:) . Please help!! :pray: : Mad Land Survival by PrashantGyawali

1 Like

Bro The concept was so cool!.It was so challenging for anyone to make a game like this.But DON’T MIND i saw some critical things in UI
Screenshot_2
Enjoyed by playing your game.It was hard though…I died almost 30 time.

1 Like

Full hand! It will look awesome but I suck at art! I made it with Ms paint :joy:
Clouds Great idea! Not hard with ms paint
Yeah the heart you made looks better
And well there is tutorial for the UI ! Please check it out ! This will make you understand hopefully!

1 Like