Have you ever been tired, sleepy, in a dream?

Last night I was taking an AP Test in my dream (lol) and was very tired, I put my head down because I couldnt stay "awake" and thought "I knew I should've listened to everyone who told me to go to sleep early.

Why does this happen, and has it ever happened to you? Perhaps it is affected by tiredness outside of the dream.