How to detect collisions from only one direction with collisionBitMask

Is there some way to to detect only collision with the physics engine form only one direction. So that if I have spriteA that is colliding with spriteB, but the collision would only happen if spriteA is colliding with spriteB form above, but if it's coming from below it would just pass through. Abit like DoodleJump.


I realise this could be done with code and boudnry rectabgles, but is there not a way to do this with the built in phsyics engine and collisionBitMask?

I tried to us ethe contactDelegate to change the collisionBitMask, but this happens to late in the chain of event.

Replies

Ok, got this working now by comparing the y position of the respective noced in physicsDidUpdate, then swicthing on and off the collisionBitMask, although it seems I also had to switch the categoryBitMask to none as well, to prevent the collisions.