Jump to content

phaser physics matter setOnCollide callback does not start


4promile
 Share

Recommended Posts

let object1 = this.matter.add.sprite(150, 150, "image1", false, { shape:{ type: "circle", radius: 50 } } )

let object2 = this.matter.add.sprite(350, 150, "image2", false, { shape:{ type: "fromVerts", verts:"0 5 75 1 106 6 121 12 132 25 132 35 50 37 55 20 8 18" } } )

object1.setOnCollide( ()=>console.log('test callback object 1') )

object2.setOnCollide( ()=>console.log('test callback object 2') )

When these two objects collide (not only with each other, with all the objects on the stage), callback function from the object2 with the body shape type "fromVerts" does not start, callback the other shape types (for example "circle") work correctly, why body shape type "fromVerts" setOnCollide callback not start?

(sorry for my english:)

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...