LaserLemon Posted April 1, 2018 Share Posted April 1, 2018 Hi everyone, I'm pretty new to Phaser, only started with it yesterday. I'm building a world with some image assets, in this case, trees that my player object will have to collide with. The code looks like this: var treeLeft = this.matter.add.image(0, (gameHeight - 96), 'tree', null, { isStatic: true }).setOrigin(0, 1); As you can see I'm adding them with Matter.js and then telling them to be static. However, my setOrigin(0, 1) is throwing off the bounding box that Matter.js assigns to the image object. Do you know of any way to make the physics bounding box coincide with my image's visible bounds? I'd like to keep the setOrigin as is because it simplifies the actual map building process for me greatly. Thanks in advance, Emile. Link to comment Share on other sites More sharing options...
LaserLemon Posted April 5, 2018 Author Share Posted April 5, 2018 Found it here: http://labs.phaser.io/view.html?src=src\physics\matterjs\offset body.js Case closed. Pavel Mishin 1 Link to comment Share on other sites More sharing options...
Recommended Posts