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
38
S
12
G
5
Posts: 151
Reputation: 5,338

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.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
71
Posts: 1,063
Reputation: 38,689

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
38
S
12
G
5
Posts: 151
Reputation: 5,338


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests