My game (with physics) has a body that works like an interruptor. This interruptor is enabled when another body is over it. The interruptor is disabled when two bodies separate each other.
My first approach was implementing onContactBegin method. I return false when those two bodies get in touch. This way the body crosses the interruptor and does not bounce.
The problem is: I want to detect when the body stops touching the interruptor. I tried to detect it in onContactSeparate method, but it isn’t called because contact did not happen.
If I return true in onContactBegin method, onContactSeparate is called and I can detect it. The problem is the body does not cross the interruptor, it bounces.
Anyone knows how can I do it? Thanks!