There are also many other things that could happen when you are going to sleep, for example you can hear voice or see someone. It is called hypnagogic hallucinations.
Mine are always triggered when life stress and anxiety build up and it makes me even more stressed.