How do I Keep From Spawning More Than One Projectile?

Just started using Construct 2? Post your questions here

Post » Thu Jan 07, 2016 3:44 pm

Everything is fine when I set the projectile to spawn right at the moment of key press-- I get one projectile per press.
____________________________________________________________________________________________________________
Function | On "Shoot" | Player: Set animation to "Fire", Spawn "Projectile" on layer 1 (image point 1)
____________________________________________________________________________________________________________
However, with the animation that goes along with it, I don't want the projectile to spawn until frame 3.
So I set it up as a new, separate event:
____________________________________________________________________________________________
Function | On "Shoot" | Player: Set animation to "Fire"

Player | Is animation "Fire" playing|
>Player | Animation frame = 3 | Player: Spawn "Projectile" on layer 1 (image point 1)

____________________________________________________________________________________________
And now on each key press, five or six projectiles are spawned from animation frame 3!
Like I said, this only happens when I restrict it to a specific frame.

How can I make it so that only one projectile is spawned per key press, on the frame I want?
B
7
Posts: 51
Reputation: 379

Post » Thu Jan 07, 2016 3:47 pm

Well the frame lasts longer than one tick..
So every tick the frame is playing, a projectile is spawned..

Adding a system trigger once while true condition should suffice..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jan 07, 2016 5:15 pm

Thanks, it worked!
B
7
Posts: 51
Reputation: 379


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest