Brings back memories... There's an old saying that the body can do some amazing things if the mind would let it but it can be a scary thing when the mind takes the body for a stroll...
I used to sleepwalk quite a bit, did some weird things, woke up in some weird places too... My sister used to get so freaked out, and so did I to be honest. I've gotten up, made a sandwich, ate it and went back to bed. My sister is watching me the whole time.
Other times i've gone for a stroll outside, thankfully we lived in a small town, no traffic. Woke up in the woods, on the front step, laying down in the street, gone visiting one of my neighbors as well... Imagine their surprise when I knock on their door at 3 in the morning... I've woken up with cuts and bruises with no idea what happened.
I took to shoving a butter knife in the door casing so I couldn't get out of the room at night

I often wondered what caused it but to my knowledge, it hasn't happened in years.