playMaker

Author Topic: How do I detect the absence of a collision[SOLVED]  (Read 1230 times)

numena

  • Playmaker Newbie
  • *
  • Posts: 2
How do I detect the absence of a collision[SOLVED]
« 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!
« Last Edit: March 29, 2017, 08:47:04 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do I detect the absence of a collision
« Reply #1 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

numena

  • Playmaker Newbie
  • *
  • Posts: 2
Re: How do I detect the absence of a collision
« Reply #2 on: March 24, 2017, 03:25:10 PM »
Thank you, it worked!