raej2010
raej2010

Reputation: 117

SKPhysicsContactDelegate protocol methods not being called

In my .h file I have added the delegate as such:

@interface GameScene : SKScene<SKPhysicsContactDelegate>

And in my .m file I have this

-(void)didMoveToView:(SKView *)view{
     self.physicsWorld.contactDelegate = self;
}
-(void)didBeginContact:(SKPhysicsContact *)contact{
     NSLog(@"contact");
}

I have nodes as well and they sometimes come into contact with one another. They have their physicsBody property rightfully set and I can't seem to figure out what the problem is. What is wrong?Thanks!

Upvotes: 0

Views: 622

Answers (1)

Revick
Revick

Reputation: 25

I had the same issue, how i solved it was making the contactTestBitMask on each node the opposite to the other.

It seems to jump into this method when both nodes have indicated their contactestbitmask to collide with each other.

Upvotes: 2

Related Questions