I'm trying to inspect collision collision of two bodies, but collision detection callbacks are not being fired. Here is my code:
1) My CCScene implements CCPhysicsCollisionDelegate protocol
2) I set collision delegate for physics
_physics = [CCPhysicsNode node];
_physics.gravity = PHYSICS_GRAVITY;
_physics.debugDraw = YES;
_physics.collisionDelegate = self;
[self addChild:_physics];
3) For each of two body I set a collision type
body1.collisionType = @"body1";
body2.collisionType = @"body2";
4) That's it, when these two bodies collide none of CCPhysicsCollisionDelegate callback methods is being called.
- (BOOL)ccPhysicsCollisionBegin:(CCPhysicsCollisionPair *)pair typeA:(CCNode *)nodeA typeB:(CCNode *)nodeB
{
NSLog(@"HELLO");
return YES;
}
Could you please help me with this? Have you been able to receive collision callbacks in cocos2d v3?
Thanks in advance