In 1943, Disney released an eight-minute film titled Reason and Emotion. The film personified the ability to think and the ability to feel as, respectively, a bespectacled, suit-wearing prig and an impulsive, lascivious caveman. “Within the mind of each of us,” intoned the narrator, “these two wage a ceaseless battle” for control of the (in the film, quite literal) mental steering wheel.

Sixty-six years later, when the animator, screenwriter, and director Pete Docter started planning Inside Out, his own film personifying the workings of the human mind, Reason and Emotion was one of the first references he consulted. He’d seen it before, as a cartoon-besotted child, and he remembered admiring its comic boldness. Watching the film again in 2009, however, he saw its limitations.

“It’s actually a propaganda film,” Docter told me during my recent visit to his office at Pixar Animation Studios, in Emeryville, California, across the bay from San Francisco. The room was dimly lit and crowded with whiskey bottles, bags of candy, and memorabilia: a Texas Avery Animation Award; a framed Buster Keaton stamp; a clay model of Kevin, the flightless bird from Up, the second feature film Docter directed. “The basic message was”—here Docter put on a stern voice and furrowed his enormous brow (his colleagues like to sketch him as a sunnier version of Frankenstein’s monster)—“Don’t let Hitler control you with fear!”

The movie, which comes out in June, tells two continuously interacting stories. The first story concerns the real-world experiences of an 11-year-old girl, Riley Anderson, who moves with her parents from Minnesota to San Francisco. (Docter is himself a transplant from Minnesota.) The second, interrelated story involves Riley’s five primary emotions: Joy, Sadness, Anger, Fear, and Disgust. They cope with Riley’s travails, and, in a sequence of plot points too elaborate to summarize, two of them (Joy and Sadness) undertake a cathartic voyage through a series of psychological locales, among them Long-Term Memory (described by Sadness as “an endless warren of corridors and shelves”), Dream Production (something like the Paramount lot), Imaginationland, and Abstract Thought.

“The idea was just this concept I had,” Docter told me. “My initial pitch to John”—John Lasseter, Pixar’s co-founder and chief creative officer—“was, You’re in a classroom, you see a kid, and the teacher asks a question. You see the kid almost raise her hand. Then all of a sudden—whoosh!—we zip into the kid’s head, and inside are her emotions.” Her emotions vie for influence. “Optimism says, ‘Oh, we know the answer. Raise your hand!’ Fear says, ‘What’re you, nuts? They laughed at that other kid. They’re gonna mock us right out of class!’ I wanted to dramatize the struggle in making a simple decision: Should I raise my hand or not?