I already fixed it. The problem was that I was pausing and starting a new scene when I changed levels, and that was overloading the game. To change levels, I just switched to changing the scene.