Hold it, hoold it, hoooold it...
LordTarantor
Member, PRO Posts: 890
Hi everybody:
I want to create an actor that when overlaps with another actor for 5 seconds another actor spawn a missile to it. Le me explain better if the robber (1st actor) steps on an actor for 5 second the sniper will shoot at him. If he gets out of the actor before it gets to 5 seconds the sniper will not shoot. Later if the robber steps in the actor the sniper will have to wait again the 5 second to be able to shoot.
how can I tell the sniper to hold it?
I want to create an actor that when overlaps with another actor for 5 seconds another actor spawn a missile to it. Le me explain better if the robber (1st actor) steps on an actor for 5 second the sniper will shoot at him. If he gets out of the actor before it gets to 5 seconds the sniper will not shoot. Later if the robber steps in the actor the sniper will have to wait again the 5 second to be able to shoot.
how can I tell the sniper to hold it?
Comments
----after 5 sec spawn actor missile
Make a global attribute called shoot, boolean.
Rule on actor 1
If collides with actor of type two (whatever that actor is called), change attribute 5seconds to true. On your "otherwise" option, change put change attribute 5seconds to false.
You need an actor to hold a rule for the timer, could be a non visible actor, or you could put it in the background actor, or wherever: Rule: if attribute 5seconds it true, timer behavior: After 5 seconds change attribute shoot to true.
On you shooter you need a rule: when attribute shoot is true, do whatever your actions are to shoot.
There might be a simpler way, but this should work.
_______________
Nesen Probe http://itunes.apple.com/us/app/nesen-probe/id377766693?mt=8
Tickle Stones http://itunes.apple.com/us/app/tickle-stones/id363484260?mt=8
Food Fight! (free) http://itunes.apple.com/us/app/food-fight/id352646643?mt=8
Thanks a lot, I was so far away from the answer.
Thank you very much