If you've ever walked into a room, then completely forgotten what you went in there for, you've experienced what's known as the doorway effect: it's almost as if the mind blanks itself as you change location, ready for some fresh experience or input.

In a new study, scientists say the doorway effect (also known as the location updating effect) does appear to be real, but only when our brains are busy. What's more, it may not be as pronounced or straightforward as previous studies might suggest.

Through a series of experiments in virtual reality, a total of 74 volunteers were asked to move through computer-generated 3D rooms, trying to remember certain objects from previous rooms – such as a blue cone or a yellow cross – as they went.

"At first we couldn't find the doorway effect at all so we thought maybe people were too good – they were remembering everything," says psychologist Oliver Baumann, from Bond University in Australia.

"So then we made it more difficult and got them to do backward counting tasks while moving around to load up their working memory."

"Forgetting did now occur, telling us that overloading the participants' memory made them more susceptible to the effect of the doorway. In other words, the doorway effect only occurs if we are cognitively in a vulnerable state."

Follow-up experiments where volunteers were asked to walk down partitioned corridors, or watch other people doing the same routine while completing memory tasks, showed no evidence of the doorway effect, the researchers reported.

So why the discrepancy between this and earlier studies that had shown changing locations led to poorer recall abilities? The team behind the new research says the similarity of the different 'rooms' – both in 3D VR and in the corridor – may have played a part in the final results.

The researchers suggest that it's not so much the doorways that cause a memory wipe, as moving from one location to a significantly different one – it's the abrupt change of scene that primes our minds to receive something new.

"A good example is moving around in a department store," says Baumann. "Taking the elevator between retail levels may have no effect on our memory, but moving from retail to the carpark might cause us to forget something that we need to buy."

Even when the study participants had a mental task to do, their likelihood of forgetting something wasn't as high as in previous research, although a busy and perhaps overloaded brain does seem to play some part in the phenomenon.

Knowing this – and understanding how a major shift in an environment can reset working memory to some extent – could give us ways to manage or mitigate against the doorway effect in the future, the researchers say. If you really want to avoid forgetting what you went into a room for though, your best bet is to keep your task at the front of your mind until it's done.

Baumann points out that the brain's ability to compartmentalize and manage memory can be really useful in a lot of situations, and helps us make sense of the world, even if we can sometimes find ourselves in a room with no idea of why.

"If the brain thinks it is in a different context, then those memories belong in a different network of information," says Baumann.

"Overall that gives us greater capacity than if you have just one gigantic workspace where everything is connected. But there is a cost to that. By transitioning between compartments we can lose things."

The research has been published in BMC Psychology.