I think we need more information. Are your nightmares very vivid? It sounds like you are describing sleep paralysis, when you say you can't move.
How often has this been occuring? Have you always had nightmares, even if they may not have been as scary or as frequent?
Do you dream a lot normally? Remember your dreams? Do these cause you to have any other problems during the day such as being tired or fatigued?
Please do not too worry about it. Google it, I have surely heard about the condition where you are 'stunned', so to say. Your mind is alive and you want to move but cannot. This is for a few seconds, and then goes. Also nightmares often have to do with bad diet/stress/depression/overeating/drinking etc. So try to avoid those. And i would strongly advise you to contact a psychiatrist in case this is persisting.