Headlining a Pixar film would mark a career high for many. Anthony Gonzalez did it near the start of his working life.

Now 12, the Los Angeles native was 9 when filming began on “Coco,” the animation studio’s first near-musical, in theaters Nov. 22. Amid a cast full of celebrated stars, Gonzalez is the clear highlight, singing and speaking the leading role — a winning boy named Miguel whose search for his family heritage and history accidentally transports him to the afterlife’s Land of the Dead.

Gonzalez sings, plays violin and viola, and is “working hard to master the piano,” he said in a phone interview. Most of all, he said, “I just love acting. I’ve been doing it since I was 4,” the age when he marched into a legendary Los Angeles talent agency for Hispanic performers, belted out a mariachi tune and was signed instantly.

He has done several commercials and last year appeared in the short film “Icebox,” a drama about a young boy in the U.S. immigration system, and its follow-up feature film adaptation with the same title. “But I never thought I would be in a Disney/Pixar movie. I grew up with ‘Toy Story’ and I just love that.”

While the voice talent in “Coco” includes Gael García Bernal, Benjamin Bratt and Edward James Olmos, it’s clearly Gonzalez in the limelight. The film is a fanciful take on the lively Día de los Muertos celebrations in Mexico and throughout Latin America. It’s a joyous holiday, winking at death rather than crying over it. As open-air markets sell folk-art skeletons and sugar skulls, it celebrates the memory of the departed with parties, food, drink and activities that the dead enjoyed in life.

Gonzalez’s character, 12-year-old Miguel, finds that colorful, hallucinogenic afterlife to be kid-friendly — a parallel world where skeletons can have warm human emotions, if not hearts. But while it’s fantastic in both senses of the word, it’s not a place a young accidental tourist wants to remain for eternity.

His Christmas present

Gonzalez describes his own visit to the wonderland that is Pixar with the same tone of awe-struck wonder as Miguel in the great beyond. It was a turn of events that was as much a lightning bolt of good luck as the slow realization of a dream.

The slow-gestating concept behind “Coco” was announced by the studio early in 2012. The same year, 20th Century Fox said it would release its own vividly colorful, musical Mexican animated adventure in the hereafter produced by Guillermo del Toro. “The Book of Life,” starring Diego Luna, Zoe Saldana and Channing Tatum, was released two years later, to limited success.

Given Pixar’s rigorous talent-recruiting system and its famously long development schedules, there was no guarantee that Gonzalez would make the casting cut.

“It was a very long process,” he said, which involved auditioning repeatedly for Oscar-winning director Lee Unkrich (“Toy Story 3,” “Finding Nemo,” “Monsters Inc.”) for nearly a year between fifth and sixth grade. He was called to interviews at Pixar’s headquarters in Oakland several times, “but I still had no idea.”

As the end of 2015 approached, he had another meeting with Unkrich to perform the character’s lines.

“Lee said he had a present for me before Christmas and he went to get the present. I opened it and it was this beautiful piece of art that said, ‘You got the part!’ I was so shocked and excited that I just fell to the ground.” While he was “crying my eyes out” with excitement, they walked to the studio. “Everyone who was there working on ‘Coco’ was there, clapping for me. I just said, ‘Oh, thank you, God, I’m just so blessed and so happy.’ ”

He felt equally moved when he finally saw the finished film last month. Most of his work had been done alone in a recording studio, with none of his co-stars present.

“They would tell me what was happening and how they wanted me to sound, and I’d take a couple of tries and go on to the next. Sometimes I got a chance to see my character on a video screen,” but working from instinct and feedback from directors was more common.

A celebration of family

While much of the film’s comedy stems from the calacas and calaveras (skeletons and skulls), Gonzalez said, “The heart of the film is family. That’s what it is about.”

For Gonzalez, whose parents emigrated from Guatemala, Día de los Muertos is a traditional family event shared with his two sisters and two brothers.

“It’s a wonderful time, a joyful one. It’s not really negative. It’s more of a celebration, a time to remember the ones who passed away that you love. To think about and thank them for how they shaped your present, past and future. When I was 6, my grandfather passed away and the only time I can connect with him and remember him is the Day of the Dead.

“It’s a wonderful celebration when you can connect with your loved ones. My family’s always there for me in the good times and the bad times. That’s what I love about it.”