How to Spawn object only once

Get help using Construct 2

Post » Mon Nov 19, 2012 11:21 pm

I have this plane that flies (doh' )   

Want this plane to shoot only one missle when it closes within a distance of another object on map.


What I did is

Event ( system -> distance(plane.X,plane.Y,myobj.X,myobj.Y) < firedistance)   then   

Action ( plane spawn missile, ... missle set angle to plane.angle)


Now what this obviously does is .. as long as the distance is less .. it will keep spawning missiles.

I only want it to spawn once.


I tried to use "trigger once" .. but that makes only the first plane to fire a missle.. and the next ones dont.


Please advise :)
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Tue Nov 20, 2012 12:09 am

add "for each" condition to range check. should work

(
For each "Plane"
system -> distance(plane.X,plane.Y,myobj.X,myobj.Y) < firedistance)megatronx2012-11-20 00:10:20
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910


Return to How do I....?

Who is online

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