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: 15
Reputation: 755

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
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

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
19
S
8
G
3
Posts: 429
Reputation: 3,972

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: 15
Reputation: 755


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 0 guests