How do I make a event, being executed after another one automatically?

Hi, I have a Sprite “Nave” that can shoot a missile from herself to a random enemy when the right mouse button is pressed. But befor that, she need to shoot a target so: Nave shoot a target to a random enemy -----> after 3 seconds ------> Nave shoot a missile from Nave to Target.
All this can be done only one time every 30 seconds.
The problem is that when the missile is available (so when 30 seconds are passed), i press the right mouse button and the Nave shoots the Target, but then it stops and the missile shoot only if I press again the same button. But doing it, Nave shoot a new Target AND the missile, both to the same enemy as the first Target choose before. How do I fix it?
This is all what I did for the missile and for the target.

Your “Target is in collision with Enemies” event should not be a sub event of the timer > 30secs and RMB down. You need to check this all the time, not only when the timer and RMB conditions are satisfied.

Also, move your Reset the timer Missile when you fire the target, otherwise you’ll be able to fire the target until a target hits an enemy. Something like:

I did the sub event and moeed the reset of the timer but it does the same thing: I need to press again the right mouse button. Doing it fires a new Target and the missile

Can you screen shot what you’ve done?

Now I can’t cause I’m away from pc. 3h and I send you the new Pic :wink:

3h and I’ll be asleep (GMT + 12). I’ll look at it in the morning if no one else has replied before then.

this is what i did. I tried a new method but it does not work. I mean, every time i press the button, it fires a new target and if the animation is finished, fires infinite missiles until the first one dies.

Your screen shot looks nothing like what I posted. Make it the same so we can see what you’ve done.

Have a think of what’s happening - Missile is greater than 30 seconds and RMB is pressed, target is fired. This will happen for every frame the condition is true, and because there are about 60 frames per second, it’ll be firing many times.

So, put a “Trigger once while true” condition on the first event to get it to fire once, and reset the timer at this stage - you already know it’s over 30 seconds…

Also, the sub event will only fire when the timer is greater than 30 seconds and RMB is down. Move it up a level so it’s not parented.

1 Like

it works now! thanks

1 Like