StarSolidStarSolidStarSolidStarOutline(3 stars)

Many of us, when we walk into a new Pixar movie, expect nothing short of excellence. But is that really fair?

After all, Pixar is a company — not a director, not a screenwriter, not an actor. Though the animation studio has had some failures in the past — “Cars 2,” blech — it has achieved enough consistent critical and commercial success that audiences have come to demand a certain level of quality every time that lamp hops onto the screen and squishes that letter “I.”

“Onward,” the latest offering from the animation studio, doesn’t quite measure up to those high standards. And yet . . .

Once upon a time, a voice-over tells us, magic existed. Not human magic; the world of New Mushroomton, where the film is set, is filled with mythical creatures: Trolls, elves and centaurs are just some of the species that share space with one another. Unfortunately, once someone invented the lightbulb and the people of New Mushroomton — let’s just call them people — figured out that flicking a switch is easier than casting a spell, they began to invent and depend on other modern comforts.

So now they live in a world filled with toasters, cars and cellphones. It’s in these modern times that we meet Ian Lightfoot (voice of Tom Holland), a teenage elf whose confidence level is as low as a troll under a bridge. Ian lives with his mom (Julia Louis-Dreyfus) and his older brother, Barley (Chris Pratt), a slacker whose only interest is a Dungeons and Dragons-type game that Barley insists is based on real events of magical times gone by. Ian and Barley’s father died long enough ago that Barley’s memories of him are hazy, and Ian’s are nonexistent.

On Ian’s 16th birthday, Mom brings out a present that Dad left behind: a wizard staff, as well as a spell that will enable him to return to life, giving the boys the chance to spend one more day with their old man. But as Ian is reciting the spell to regenerate their father, something goes wrong, leaving the brothers looking at a pair of legs, and nothing up top. The only thing that can bring the rest of their father back is a magical stone and recasting the spell before time runs out.

The boys set out on a journey to find that stone — Barley confidently, and Ian cautiously.

The journey doesn’t have an auspicious beginning, either for the brothers or for the audience. The opening scenes have a flat look where everything is cast in a dull, blue light. Ian and Barley are tropes, not fully formed characters, a situation that isn’t served by typecasting Holland as a nervous Peter Parker type, and Pratt as a variant of the slightly oafish Andy from “Parks and Recreation.”

The script (co-written by director Dan Scanlon with Jason Headley and Keith Bunin) lacks both emotion and wit, a hallmark of most Pixar films. And the quest at the heart of the story lacks a sense of real urgency.

But Scanlon (“Monsters University”) shows he’s got a trick up his sleeve. Both the visuals and the story get better — almost imperceptibly — with every step the boys take. Suddenly, the fog of the film’s first half-hour lifts, putting you in a world that’s not just visually impressive but makes you care about the characters. It happens so gradually that when the story starts exploding, it’s nearly a complete surprise.

Look, “Onward” isn’t even close to top-shelf Pixar. But judging it on its own merits, it’s an often funny, genuinely moving story that takes enough twists along the way that the quest becomes a suspenseful journey. In a great running gag that evokes “Weekend at Bernie’s,” Ian, freaked out by his topless father, builds him a torso out of a stuffed hoodie — which the boys lead around via a leash.

“Onward’s” biggest handicap may, ironically, be its pedigree, which means that it will inevitably be compared with some of the greatest animated films — some of the greatest films, period — of modern cinema. And yet, even though it starts with hesitant steps and hits some roadblocks along the way, “Onward” is ultimately a trip worth taking.

PG. At area theaters. Contains action, peril and some mild thematic elements. 97 minutes.