PLEASE READ THIS BEFORE WATCHING My idea is Sans worked with Gaster, as his lab partner. The giant machine that is the same as Sans's weapon in the fight with him, aka the "Gaster Blaster", was built to be a portal out of the Underground. If it worked, every monster would be free. THIS WAS BEFORE FRISK. Sans and Gaster were able to teleport objects through, but Gaster wanted to send himself through. BUT, him and Sans had never sent a monster through, so they didn't know what would happen. Sans was very cautious, because they had never sent a monster through before, and was scared about what could happen. Gaster: "Reverse it once the green light flashes on the motherboard, okay?" Sans: "Gaster, I..." Gaster: "Good luck, captain." Instead of a green light, a red light flashed instead; showing Gaster had not gone through. Instead, the monster was "killed", and Sans was so sad (becuase he secretly really loved Gaster and now could never tell him) he got deppression. Later, now Frisk has fallen into the Underground, Sans hides his deppression by cracking jokes and faking his smiles to everybody he knows. Thought, he spent every night after telling Papyrus his bedtime story, trying to complete the portal for Gaster. FEELS INTENSIFY