Closets in this game are quite odd. I'll be talking about how closets work in Jim's Computer. Before I begin, I got something to say. THIS MIGHT NOT BE EXACTLY ACCURATE BUT IT COVERS THE BASICS OF HOW THE CLOSETS FUNCTION IN THE GAME. There are 2 parts to how closets function in this game: the server sided events and client sided events. I'll first be starting with the client sided events.
If you don't know what a client is then basically in the context of game development, a client is the player's individual instance of the game, while the server manages the overall game state. With that out of the way, let's get into how the closets work. When you touch a closet, your game client detects the closet as already being opened. Your client sends a message to the server basically tells the server that you have touched the closet. When you have touched both closets after a few seconds text saying "I feel safe again..." will fade onto your screen (depending on the day in the game) and the game will allow you to go back to bed (also depends on the day).
Okay so the closet is touched. What happens on the server? Well, the server receives that event and sets the players speed to 0 so that they cannot move. The game then does something I personally find well... weird. The game sends another remote event to the players client basically going like "Yo. what do I do now?" It needed to switch back to the client because the server doesn't have direct access to the client's camera (which they could have just solved by NOT sending to the server and just doing it all client sided but I won't judge. Their the dev and I'm the player).
The game client sets your camera type to "Scriptable" so the game can animate your camera. The game then animates your camera to look into the closet by using Tweenservice (Roblox game service used to animate any property). After the animation plays, your speed is set to what it was before and your camera type is set to "Custom" (the default camera type for ROBLOX games).
That is basically all there is to it. If you want to dig deeper into how "Tweenservice" or "CFrame.Lerp" works, then you can search for documentations on them.
Camera Properties:
I don't actually have the game files. All of the information found is based on observation and from playing the game itself.