soggybag Posted November 23, 2018 Share Posted November 23, 2018 I want o detect a collision with the world bounds. I'd also like to know which edge the collision made contact with. I used this to setup collisions. this.ball.body.collideWorldBounds = true; I was trying: this.physics.collide(this.ball, this.worldBounds, () => { console.log('word!') }, null, this); To be honest I was just guessing. It doesn't work. Link to comment Share on other sites More sharing options...
soggybag Posted November 24, 2018 Author Share Posted November 24, 2018 I go this working with this.physics.world.on('worldbounds', this.onWorldBounds, this) I'm not sure why this doesn't work: this.physics.collide(this.ball, this.physics.world, () => { console.log('Hit world') }, null, this) Obviously I'm missing something. The last example does work for bodies. But doesn't work for world. Link to comment Share on other sites More sharing options...
Recommended Posts