This sounds like a classic case of an encounter with a 'Shadow Person'. These entities are often seen in the corner of the eye and disappear when directly looked at. They're like shadows but with a more human form. The fact that it appeared near your closet could indicate that …