Object spawner / For each

Get help using Construct 2

Post » Mon Oct 09, 2017 1:54 pm

I'm trying to create an object spawner that spawns objects every X seconds (based on instance variable) and sets the angle, speed etc for spawned objects (with bullet behavior).

It works great for one object but as soon as I duplicate the spawner / hitboxes each spawner uses/triggers at the same X seconds value (when the intention is for each to trigger based on spawner object's individual instance variable). I tried adding the usual "For each", "Trigger once" etc. but can't get it to work right.


Thanks for any help!
Last edited by Waltuo on Mon Oct 09, 2017 4:41 pm, edited 1 time in total.
B
35
S
10
G
4
Posts: 149
Reputation: 4,559

Post » Mon Oct 09, 2017 3:42 pm

Instead of the "Every X seconds" event, use Timer behavior.
Image

You probably don't need "For each .." condition in the "On timer" event, but I prefer to add it for clarity.
Check out my awesome game Doptrix
B
17
S
9
G
29
Posts: 515
Reputation: 16,829

Post » Mon Oct 09, 2017 4:38 pm

Thanks @dop2000 ! I thought about using the timer behavior but figured this would've worked without it. Anyway, your solution worked perfectly and it's spawning exactly as should :) Thanks again for your help!
B
35
S
10
G
4
Posts: 149
Reputation: 4,559


Return to How do I....?

Who is online

Users browsing this forum: PROxMTswatTR, sean080 and 37 guests