Is it possible to determine if a b2body has collided with another b2body from a different layer? Also, how would I do that?
E.G.
I have a ball on my main game scene layer that is fired at a bomb in my level one layer. They collide and the bomb disappears.
Please let me know if I need to be more clear
Thanks!
If you want bodies to collide they must belong to the same b2World. On what layer they are drawn and how does not matter to the physics. To determine when collision happens subclass
b2ContactListenerand implement callback functions:then add the object of this class to your b2World: