iKest Posted August 29, 2018 Share Posted August 29, 2018 Good day. I make pool with containers and i need add to containers matter body without add this in matter world. i do it through: this.container = getCustomContainer(this.pool) this.matter.add.GameObject(this.container) this.matter.world.remove(this.container) ... this.container.SetBody(...) and it seems to me not right... Link to comment Share on other sites More sharing options...
ol-web Posted August 29, 2018 Share Posted August 29, 2018 It's very hard to understand what you're saying. An actual code example on codepen would help. If you need to add matter bodies to a container then I don't think it's possible. Containers can only have one body AFAIK. If that's not what you meant then perhaps you're using setBody wrong. The code below worked for me. There's no usage description of it but you can get a guess of what you need to pass there from here: https://github.com/photonstorm/phaser/blob/v3.11.0/src/physics/matter-js/components/SetBody.js this.container.setBody({ type: "circle", x: your_x_position, y: your_y_position }); Link to comment Share on other sites More sharing options...
Recommended Posts