For the first hour or so of its ninety-minute running-time, this CGI-animated, 3-D adaptation of Judi and Ron Barrett’s 1982 children’s book has considerable charm and even wit—enough, fortunately, to compensate for the slam-bang save-the-world finale that ratchets up the noise and action but loses altitude despite the heights to which the characters climb. “Cloudy with a Chance of Meatballs” doesn’t soar like “Up,” but it stays afloat long enough to remain a pleasant family treat.

The star of the show is Flint Lockwood (voiced by Max Neuwirth), a nerdy kid living on an imaginary island town in the Atlantic whose economy was devoted completely to fishing and canning sardines until the market, shall we say, dried up. Max is a would-be inventor whose crazy gizmos always turn out disastrously, much to the distress of his beetle-browed father Tim (James Caan), who runs a bait and tackle shop. Now grown up (and now voiced by Bill Hader), Flint is working, along with his “assistant,” a monkey named Steve (Neil Patrick Harris) on his latest idea—a machine that will turn water into food—at the moment the mayor (Bruce Campbell) is about to open an amusement park he hopes will revitalize the economy—Sardine Land, to be christened by the only local celebrity, ‘Baby’ Brent (Andy Samberg), whose picture used to appear, diaper and all, on the sardine cans that were the place’s stock and trade until the factory shuttered.

Flint’s klutziness manages to wreck the park, of course—which brings yet another rant from the hyperactive island cop (Mr. T). But his machine works, and begins raining edibles of all sorts from the clouds. That creates a scoop for Sam Sparks (Anna Faris), the weather network intern sent to cover the park opening. Before long, of course, she and Flint will become an item.

Things turn bad, however, when the gluttonous mayor overloads the machine and it starts producing entirely too much stuff, threatening to break the dam and flood the town. Flint, Sam, Steve, ‘Baby’ and Sam’s taciturn cameraman Manny (Benjamin Bratt) are forced to rocket into the stratosphere to enter the malfunctioning device and overcome all sorts of obstacles to shut it down. Need one doubt the success of their mission?

Prior to that big last act, “Cloudy with a Chance of Meatballs” is good fun. The animation, the first done with Sony’s new software, is distinctive and colorful, though the 3-D frankly doesn’t add much to it (in the first half-hour characters point their fingers toward the audience entirely too often, though happily they stop after awhile). And more importantly, the script is excellent, with plenty of clever lines and oddball incidents. And the characters are, for the most part, amusing. Hader’s Flint is likable, and Faris does the spunky newswoman nicely. Even better is Caan, whose muffled growl fits his animated character perfectly (one of the best gags of the finale has to do with his computer illiteracy), and he’s nearly matched by Mr. T, whose ranting style is equally suited to the high-strung cop. Campbell’s mayor and Samberg’s Brent are more problematic. The characters grow irritating and shrill, and the actors tend to oversell them. As for Harris, well, it’s never easy voicing a chimp.

CGI-animated family movies are very thick on the ground nowadays—as thick as the pancakes Flint’s machine drops from the clouds. This one is more fun than most.