Jump to content

Uncaught TypeError: Cannot read property 'GetType' of null


Tufan
 Share

Recommended Posts

Sometimes this error occurs after destroying a sprite.

Uncaught TypeError: Cannot read property 'GetType' of null
    at box2d.b2Fixture.GetType (box2d-plugin-full.min.js:9)
    at box2d.b2ContactFactory.Create (box2d-plugin-full.min.js:9)
    at box2d.b2ContactManager.AddPair (box2d-plugin-full.min.js:9)
    at box2d.b2BroadPhase.UpdatePairs (box2d-plugin-full.min.js:9)
    at box2d.b2ContactManager.FindNewContacts (box2d-plugin-full.min.js:9)
    at box2d.b2World.Step (box2d-plugin-full.min.js:11)
    at Phaser.Physics.Box2D.update (box2d-plugin-full.min.js:13)
    at c.Physics.update (phaser.min.js:3)
    at c.Game.updateLogic (phaser.min.js:3)
    at c.Game.update (phaser.min.js:3)

 

$.each(client.entities, function(i,v){
	if (v.nametag){
		v.nametag.destroy();
	}
	v.destroy();
	delete client.entities[i];
});

Should i call body.destroy before? Setting body.removeNextStep to true must delete body correctly but it doesn't trigger an event so i don't know when to delete sprite.

Phaser CE v2.7.10

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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