Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: numena on March 23, 2017, 08:49:24 AM

Title: How do I detect the absence of a collision[SOLVED]
Post by: numena on March 23, 2017, 08:49:24 AM
Hi all,

I have an iTween animation that lasts 3s. During this animation, it's possible for a trigger exit event to happen. How do I detect this trigger exit without cutting the animation short (which is what happens if I add a Trigger Exit detector to that state)? If the Trigger Exit detector is added after the animation, it detects nothing because the exit had already happend.

Is there an action that is the opposite of On Trigger Stay? ie that detects the absence of any collision? Or a way for a state to remember that a Trigger Exit happened during the animation, but wait to act on that information until the animation is over?

Thanks!
Title: Re: How do I detect the absence of a collision
Post by: jeanfabre on March 24, 2017, 02:46:27 AM
Hi,

 you'll need to catch OnTriggerExit, and if you have several possible collision, you will need a counter, increment the counter on OnTriggerEnter and decrease OnTriggerExit, then everytime you have OnTriggerExit, and the counter is 0 then you know there is an absence of collision moment.

 Bye,

 Jean
Title: Re: How do I detect the absence of a collision
Post by: numena on March 24, 2017, 03:25:10 PM
Thank you, it worked!