Yeah, as David_G said it's sleep paralysis. When you enter into deep sleep (dreaming, as you mentioned) it's basically your conscious mind shutting down and your unconscious mind defragging. While that happens, your body is essentially shut down to keep you from thrashing in response to a...