Jump to content

Creating Groups with MatterJS enabled bodies?


jurbank
 Share

Recommended Posts

How do I enable MatterJS based physics in my group bodies?

I have the following:

    this.bullets = this.scene.add.group({
      key: 'bullet',
      frame: 0,
      repeat: 5,
      maxSize: 10,
      setXY: { x: 32, y: 100, stepX: 40 }
    });

And I'm noticing the body value (at the bottom) is 'null'
2056295269_ScreenShot2018-09-21at8_29_39AM.png.a0d177e48d3465738a3e20619d99b4d3.png

Based on this tutorial - https://phaser.io/tutorials/making-your-first-phaser-3-game/part8 

It uses 'this.physics.add...' but unfortunately, 'this.physics' isn't available. Perhaps because I'm not using Arcade Physics?

I also tried 'this.bullets.enableBody = true;' which doesn't seem to do anything.

Thoughts?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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