In the Woody Allen comedy “The Purple Rose of Cairo,” a character in a film steps off the movie screen and becomes a part of real life, changing his fate. Now, with virtual reality tools, the film director Jon Favreau wants to give viewers the opposite experience, taking them inside the movie and having their actions dictate what comes next.

“Gnomes & Goblins” is Mr. Favreau’s experiment with virtual reality, or VR. Hovering somewhere between a movie and a game, the preview version of the project makes you the protagonist and sets you in the middle of an enchanted forest, where you can build a relationship with a timid, tiny goblin living there. How you choose to interact with him determines where the story goes.

The environment has the tactile nature of the jungle in Disney’s new version of “The Jungle Book,” which Mr. Favreau directed. But in this project, it’s as if instead of watching Mowgli, you are Mowgli, free to wander and explore at your own pace.

Image A goblin from “Gnomes & Goblins.” Credit... Wevr

The preview will be available free starting Thursday on the Steam, Viveport and Wevr Transport entertainment platforms, initially for the HTC Vive VR headset, which comes with a hand controller so you can (virtually) pick up objects, like fruit on a tree. (It will be available on Oculus Rift and PlayStation VR later in the year.)