Try this
function hitBox(player, box) {
box.play('breakBox', false)
box.once('animationcomplete', (box)=>{
box.destroy()
})
}
Try this
function hitBox(player, box) {
box.play('breakBox', false)
box.once('animationcomplete', (box)=>{
box.destroy()
})
}