How do I randomly spawn different objects

Get help using Construct 3!

Post » Thu Jul 27, 2017 7:06 am

I'm trying to figure out how to randomly spawn different objects at different times like in a endless jumper when it spawns a platform I want it to randomly spawning 1 of 7 different platforms instead of just spawning the same platform
B
9
S
4
Posts: 16
Reputation: 757

Post » Thu Jul 27, 2017 10:59 am

I do this by setting a variable with choose, so choose(1,2,3,4,5,6,7) will choose one of those numbers at random. Then the number chosen relates to a platform. If var=1, spawn platform 1, if var=2 spawn platform 2 etc.
B
47
S
17
G
82
Posts: 2,232
Reputation: 48,611

Post » Thu Jul 27, 2017 11:10 am

Here are three different ways you can spawn random objects:

https://www.dropbox.com/s/ukysthmxiv9cf ... .capx?dl=0

Method 1) Add objects to a family and then spawn the family object - a family member will be picked at random.
Method 2) Save different animations on a sprite and then choose a random animation after spawning.
Method 3) Save different frames to an animation on a sprite and then choose a random frame after spawning (remember to set the animation speed to 0 in the sprite settings).
B
21
S
9
G
4
Posts: 473
Reputation: 4,285

Post » Fri Jul 28, 2017 4:03 pm

Setting the variable with choose did the job thank you for that
B
9
S
4
Posts: 16
Reputation: 757


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 0 guests