jurbank Posted September 21, 2018 Share Posted September 21, 2018 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' 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 More sharing options...
jurbank Posted September 21, 2018 Author Share Posted September 21, 2018 I found that you can add a class type: https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Group.html this.bullets = this.scene.add.group({ key: 'bullet', frame: 0, repeat: 5, maxSize: 10, classType: Phaser.Physics.Matter.Image(this.world, 0, 0, null, null, {}), setXY: { x: 32, y: 100, stepX: 40 } }); Still not working though Link to comment Share on other sites More sharing options...
Recommended Posts