Thomas Metzinger had his first out-of-body experience when he was nineteen. He was on a ten-week meditation retreat in the Westerwald, a mountainous area near his home, in Frankfurt. After a long day of yoga and meditation, he had a slice of cake and fell asleep. Then he awoke, feeling an itch on his back. He tried to scratch it, but couldn’t—his arm seemed paralyzed. He tried to force the arm to move, and, somehow, this shifted him up and out of his body, so that he seemed to be floating above himself. Gazing out into the room, he was both amazed and afraid. He heard someone else breathing and, in a panic, looked around for an intruder. Only much later did he realize that the breathing had been his.

At the time, in the early nineteen-eighties, Metzinger was a philosophy student researching the mind-body problem at the Johann Wolfgang Goethe-Universität. During the postwar years, Theodor Adorno and Max Horkheimer had made the university’s Institute for Social Research—the Frankfurt School—a center of neo-Marxist thought, and the campus remained a politically radical place. In Britain and America, philosophers, computer scientists, psychologists, and neuroscientists were working together to reconceive the mind as a purely physical system created by the brain. In Metzinger’s department, such theories were denounced as anti-human and “proto-fascist.” Metzinger considered himself a radical—he had waist-length hair, and was proud to have been teargassed while protesting the U.S. military—but also a rationalist. Immersing himself in the work of the Anglophone philosophers, he’d eventually become convinced that his soul was made by his brain. He was, therefore, doubly shocked by his out-of-body experience, which had seemed irrevocably real. Could materialism be wrong? Could consciousness exist immaterially, outside of the body? He admonished himself: “How arrogant I have been!”

Metzinger began reading about out-of-body experiences. He learned that between eight and fifteen per cent of the population reports having had an “O.B.E.”—perhaps during the night, or after surgery—and that, for millennia, people have seen in such experiences evidence for various mystical theories of the soul. (Many religious traditions hold that there is a “subtle body,” or immaterial version of the self, capable of travelling through space.) Meanwhile, on occasional evenings, he floated around his room. One night, he tried to use the light switch (it didn’t work); he decided to fly through the window and visit his girlfriend, but woke up instead. Metzinger began experimenting on himself. Following the advice of New Age “astral travellers,” he stopped drinking liquids at noon, stared at a glass of water in his kitchen, and then slept with salt in his cheek, hoping to travel back to the glass at night. Before a minor surgery, he persuaded his anesthesiologist to alter his medication so that he could wake up early enough to experience the effects of the drug ketamine, which is famous for inducing out-of-body experiences. The salt had no effect, and the ketamine resulted in hours of unpleasant phantasmagoric hallucinations. Metzinger could find no way to produce O.B.E.s on demand, or to study them systematically.

In 1983, the psychologist Philip Johnson-Laird had published a book called “Mental Models,” in which he argued that people often think not by applying logical rules but by manipulating models of the world in their minds. If you want to know whether a rug will go with your sofa, you don’t deduce the answer—you imagine it, by moving furniture around on a mental stage set. During a heated dinner conversation in Tübingen, the psychologist Susan Blackmore, who had studied O.B.E.s, suggested to Metzinger that he hadn’t actually floated around his room: “You were probably moving around your mental map, in your world model,” she said. “No fucking way!” Metzinger remembers thinking. “These experiences are too realistic!” Later, he decided that Blackmore was right. Having read Johnson-Laird, he’d begun to wonder whether reality, as we experience it, might be a mental stage set—a representation of the world, rather than the world itself. Having an O.B.E. could be like visiting the set at night, when it wasn’t being used. Metzinger started to think about how such a model might be constructed. Some internal mental system must function as an invisible, unconscious set dresser, making an itch feel like an itch, coloring the sky blue and the grass green.

As Metzinger developed these ideas, he also had fewer out-of-body experiences. Eventually, they ceased altogether; he set the subject aside and became an eminent philosopher of mind. Then, in 2003, he heard from a Swiss neuroscientist named Olaf Blanke, who had learned how to give people out-of-body experiences when they were fully awake. While treating a forty-three-year-old woman with epilepsy, Blanke had applied electrical current to a particular area of her brain, and she had the experience of floating upward and looking down at her own body. Blanke had found many related illusions. Stimulating another location in the brain created the impression of a doppelgänger standing across the room; stimulating a third created the “sense of a presence”—the feeling that someone was hovering nearby, just out of sight. Unsure how to interpret these results, Blanke had searched the literature and come across some papers by Metzinger. They took the idea of mental models to its logical conclusion. It isn’t just that we live inside a model of the external world, Metzinger wrote. We also live inside models of our own bodies, minds, and selves. These “self-models” don’t always reflect reality, and they can be adjusted in illogical ways. They can, for example, portray a self that exists outside of the body—an O.B.E.

Metzinger and Blanke set about hacking the self-model. Along with the cognitive scientists Bigna Lenggenhager and Tej Tadi, they created a virtual-reality system designed to induce O.B.E.-like episodes. In 2005, Metzinger put on a virtual-reality head-mounted display—a headset containing a pair of screens, one for each eye, which together produce the illusion of a 3-D world. Inside, he saw his own body, facing away from him, standing in a room. (It was being filmed by a camera placed six feet behind him.) He watched as Lenggenhager stroked its back. Metzinger could feel the stroking, but the body to which it was happening seemed to be situated in front of him. He felt a strange sensation, as though he were drifting in space, or being stretched between the two bodies. He wanted to jump entirely into the body before him, but couldn’t. He seemed marooned outside of himself. It wasn’t quite an out-of-body experience, but it was proof that, using computer technology, the self-model could easily be manipulated. A new area of research had been created: virtual embodiment.

From 2010 through 2015, the virtual-reality researchers Mel Slater and Mavi Sanchez-Vives worked with Metzinger and Blanke, in a fourteen-partner E.U.-funded project called Virtual Embodiment and Robotic Re-Embodiment. Their labs, in Barcelona, used immersive virtual reality to manipulate the body models of research subjects, convincing them that the bodies they possessed in V.R. were their own. (Slater and Sanchez-Vives are married; they met at a V.R. workshop, in 2001.) “We have the illusion that our body model is very stable, but that’s only because we’ve never encountered anything else,” Sanchez-Vives said. People who are extremely aware of their bodies—dancers, athletes, yogis—can find the adoption of a virtual body difficult, because they have trouble “letting go.” “But the more you do it the easier it becomes. After you’ve experienced it once, twice, you click into it.” In the past few years, Slater, Sanchez-Vives, and other virtual-embodiment researchers have discovered therapeutic and educational uses for the technology. Meanwhile, Metzinger, along with the philosopher Michael Madary, has drafted a virtual-reality “code of ethics” focussed on embodiment, which he believes makes V.R. fundamentally different from all other media. Embodied virtual experience, the philosophers write, can change us profoundly. It can affect us in ways we barely understand, redefining “the very relationship we have to our own minds.”