I'm currently facing issues with the animate() function, as it tends to crash my browser and cause my computer to heat up when errors occur. I attempted to use a try/catch handler to handle these errors but it did not work as expected.
animate(){
this.renderer.render(this.scene, this.camera);
try {
// functions that update scene
} catch (error) {
gsap.ticker.remove(() => this.animate());
console.error(error);
}
}
Check out this Codepen Example for reference.
Can anyone offer suggestions on effectively error handling with a 'requestAnimationFrame'/gsap.tick loop?