How to destroy mesh in high loaded game?

I have Arkanoid like 2d game. So I can have 6 or more balls at board, they destroy blocks pretty fast and sometimes I catch this exception in console: ‘_wakeUpAfterNarrowphase’.
Can you give me any advices to overcome this problem. I already tried to use setTimeout(() => block.dispose()).

unknown-3

Could try waiting until after the physics frame is finished if you’re disposing it during that, e.g. in reaction to a collision.

scene.onAfterPhysicsObservable.addOnce(() => {
    block.dispose();
});
2 Likes

Hi just checking in, was your question answered? @Cmexxx

Yes:) Thanks a lot. Sorry, I forgot to mark question as answered.

2 Likes