When UC Berkeley psychologist Dacher Keltner attended the Hollywood premiere of the new Pixar movie Inside Out—which opens today in theaters nationwide—he was thrilled to see children running around the purple (not red) carpet yelling, “I’m Fear,” “I’m Sadness” or “I want to be Anger.”

GGSC director Dacher Keltner

Kids typically don’t like to identify, let alone broadcast, difficult feelings, including the ones that loom large inside the head of the movie’s central character, 11-year-old Riley, as she struggles with her family’s relocation from Minnesota to San Francisco.

So a movie like Inside Out, which explains how positive and negative emotions can bump up against each other and yet also team up to solve a problem, can be empowering for both children and adults, as Keltner witnessed at its debut.

“I hope this movie becomes part of our cultural understanding of what it means to be a child and what it means to be a human being and to grapple with these emotions,” Keltner says.

An expert on the science of emotions, Keltner served as a consultant on the movie, visiting Pixar’s Emeryville campus a half-dozen times to explain the basis, physiology, and purpose of emotions, and exchanging many emails.

“They were really interested in what happens with memory. How does my sadness right now color my recollection of my childhood? Keltner says.

The insights that Keltner and his mentor, psychologist Paul Ekman, provided helped to flesh out the animated personifications of Joy, voiced by Amy Poehler, Anger, by Lewis Black, Fear, by Bill Hader, Disgust, by Mindy Kaling and Sadness, by Phyllis Smith.

Video courtesy of Pixar Animation Studios

Filmmakers grappled with the purpose of sadness, but Keltner set them straight.

“In our culture, we’re tough on sadness, but it’s a powerful trigger for seeking comfort and bonding,” Keltner says. “Meanwhile, anger is often about the sense of being treated unfairly, and can be a motivator for social change.”

Keltner met Inside Out director Pete Docter, who also directed Pixar’s Up and Monsters Inc., when their daughters were at various stages of puberty. They bonded over the travails of parenting during those volatile years.

“When they get to their preteens and early teens, it’s like the world crashes down on them,” Keltner says. “One of the most precipitous drops in happiness occurs around 13.”

Their discussions eventually evolved into Inside Out, the results of which have exceeded Keltner’s wildest expectations: “I was blown away,” he says. “I don’t think I’ve ever seen anything like it.”

Keltner, who has taught psychology at Berkeley since 1996, posits that everyone has a “signature emotion”—just like Inside Out’s Riley, who leans toward joy—but it evolves over the course of a lifetime.

In Keltner’s case, for example, the signature emotion during his youth was contempt, he says, which turned to fear and anxiety in adulthood, and has more recently evolved into compassion. Eventually, he’d like his signature emotion to be contentment.

As for how all the emotions roiling in Riley’s head coordinate with her intrinsic sense of joy, he says: “You’re just going to have to watch the movie and find out.”