In “Onward,” the latest animated feature from Pixar, two elf brothers cast a magic spell that half-succeeds: They bring their dead father back to life, but only from the waist down, as a pair of sentient pants and shoes.

At the box office this weekend, the movie was met with similarly mixed success.

“Onward” opened to an estimated $40 million in domestic ticket sales Friday through Sunday, more than enough for first place, but it’s relatively weak for a Pixar movie. For comparison, Pixar’s “Inside Out” opened to roughly $98 million in domestic sales in June 2015, adjusting for inflation. The studio released “Onward” unusually early in the year; it typically puts out movies around summer or during the holiday season.

The plot of “Onward” revolves around the brothers’ quest to fully reincarnate their father. (The siblings are voiced by Tom Holland and Chris Pratt.) The quest takes them on a tour through their universe, which is populated by fantasy creatures (like elves and dragons) who have largely given up magic in favor of technology. (Octavia Spencer voices a manticore who runs a restaurant; Julia Louis-Dreyfus voices the boys’ mother.)

“Onward,” directed by Dan Scanlon (“Monsters University”), holds an 86 percent fresh rating on Rotten Tomatoes, but that good reception is modest by Pixar standards: The studio’s past three movies (“Toy Story 4,” “Incredibles 2” and “Coco”) all have Rotten Tomatoes scores of 94 or above. In his review for The New York Times, Ben Kenigsberg wrote that the movie’s central journey “plays as disappointingly routine, a checklist of mechanically foreshadowed heart-to-hearts and lessons learned, leavened by the occasional offbeat sight gag.”