I am currently developing an online real-time game that involves storing all players and their animation mixers in arrays. However, I have encountered an issue when a player leaves the game. Whenever I attempt to splice them from the player array, the program freezes.
var index = i;
scene.remove(players[index]);
players[index].geometry.dispose();
players[index].material.dispose();
players.splice(index, 1);
interval.splice(index, 1);
mixers.splice(index, 1);
anim.splice(index, 1);
ids.splice(index, 1);
Why does the program freeze when I try splicing these arrays?