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
39
S
12
G
8
Posts: 580
Reputation: 7,108

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
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

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
63
S
23
G
17
Posts: 254
Reputation: 14,342


Return to How do I....?

Who is online

Users browsing this forum: Governador, tarek2, Thelegendvinny, Yahoo [Bot] and 19 guests