Right!
Nightmares, which are dreams that cause high levels of distress or terror, occur more often when you are stressed or anxious. They are more likely to occur in the last third of the night and tend to be more common among children than adults.