Looking for a way to check for any errors in the animate() function. If there are any errors that happen in the animate() function my browser crashes and my computer heats up.
I tried to have the code in a try/catch handler but this doesn't work
animate(){
this.renderer.render(this.scene, this.camera);
try {
// functions that update scene
} catch (error) {
gsap.ticker.remove(() => this.animate());
console.error(error);
}
}
Any suggestions how to correctly error handle with a 'requestAnimationFrame'/gsap.tick loop?