Jump to content

Phaser p2js onBeginContact gives null body


rmxhaha
 Share

Recommended Posts

at first my code working alright then I tried to add collisionGroup to all the sprites there is. Because I usually declare classes outside the create function I must move them inside because collisionGroup can only be created after the physics has been initiated which must be initiated inside the create function. After I finish all that an error occur onBeginContact is giving a null on it's first parameter which is strange because it should be giving a body under all circumstances.

The second and third parameter is given as usual but I don't know if it's out of the ordinary because i never use those parameters.

 

What cause this ?

 

Link to comment
Share on other sites

I think this is a bug within either phaser or p2js... 

I tried the CollisionGroup example and add 

		panda.body.onBeginContact.add(function( first ){			if( null == first ) console.log( "Found the bug" );		}); 

the it Found The Bug is printed

delete the collision group then it doesn't happen again

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...