For Each Random Spawner

Get help using Construct 2

Post » Tue Apr 02, 2013 4:50 pm

Hi - I'm trying to create a spawner object.

I want at random intervals each spawner to spawn another object - but I can't work out how to make it so each spawner is independently random. At the moment, every spawner object spawns at the same time.

I would post a cap but my project is quite big, if there's no easy fix I'll re-create what I've done in a blank project.

Thanks all.
B
44
S
13
G
8
Posts: 622
Reputation: 7,417

Post » Tue Apr 02, 2013 5:31 pm

Hi,

why not attach a timer to each spawner

set an instance variable of a random number of seconds for each spawner then every second ( or however often ) decrease the variable. When it reaches zero spawn your object.
B
50
S
16
G
9
Posts: 1,098
Reputation: 11,237

Post » Tue Apr 02, 2013 7:03 pm

I think if you put the spawners in a family, and then use the family for the spawn action it will pick a random spawner from that family.

Also, you can use the system condition "Pick random instance".

https://www.scirra.com/manual/124/system-conditionsXavier2013-04-02 19:07:22
B
75
S
29
G
17
Posts: 256
Reputation: 15,250


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests