In recent times, there has been growing disinterest by students in STEM disciplines (science, technology, engineering, and mathematics). This trend is especially acute in those students who do not take STEM content during their secondary or high school education. This disinterest might be conditioned by negative emotions towards science developed by students during the different educational stages, even from an early age. In this sense, active teaching methodologies, such as gamification, play a fundamental role in fostering positive emotions towards learning STEM content. Within the wide range of gamification methodologies, we find educational Escape Rooms. Due to the current situation generated by COVID-19, many of the lessons have had to be adapted to a virtual format through various online platforms. In this study, in a preliminary manner, we aim to analyze the effects on the affective domain produced by a virtual Escape Room used in a STEM course as an instructional tool to teach contents about the Universe to teachers in training. According to the results obtained, the positive emotions of “happiness”, “satisfaction” and “fun” are significantly increased after the intervention. At the same time, some negative emotions, such as “nervousness”, “frustration” and “worry” also increase, partly due to the components typically found in this type of games. Based on these results, it is concluded that, despite the existence of both positive and negative emotions, the results are promising and the intervention is motivating and stimulating for the students.