I have used Phaser 2 for a while but recently converted to Phaser 3 and I want to know if there is a method or member that might be equivalent to 'outOfBoundsKill'. I have an Arc Object in Phaser 3 and applied gravity to it and I want to make sure it is killed or destroyed when it is out of bounds of the canvas.
More about outOfBoundsKill: https://phaser.io/docs/2.6.2/Phaser.Sprite.html#outOfBoundsKill
I have tried this code sample and it did not destroy the arc object, 'ball' is the arc object.
ball.on('worldbounds', function() {
if (!Over) {
ball.destroy();
HealthBar.livesLeft -= 1;
HealthBar.cs.scale.x = HealthBar.livesLeft / HealthBar.lives;
var shake = this.sound.add('shake');
shake.play();
}
}, this);