There’s something odd about “Captain Underpants: The First Epic Movie”—beyond the fact that it’s about an obese, dimwitted guy in tighty-whities and a red cape who’s endowed with super-powers. The really peculiar thing is that the movie, based on the popular series of children’s books by Dav Pilkey, is rather amusing for the first half-hour or so, when it concentrates on fairly ordinary elementary-school highjinks. At that point, however, the Captain himself enters the picture, which promptly turns into a frenetic but disappointing spoof of the superhero genre, and what’s supposed to be the movie’s selling point instead becomes its Achilles heel.

The movie’s initial stretch focuses on George Beard (voiced by Kevin Hart) and Harold Hutchins (Thomas Middleditch), best friends and incorrigible fourth-grade pranksters who drive Mr. Krupp (Ed Helms), the Jerome Horwitz school principal, crazy. Enlisting their brainiac classmate Melvin Sneedly (Jordan Peele), he gets proof of their shenanigans and plans to put them in separate classrooms, ending their troublemaking ways by keeping them apart.

The duo are despondent until Captain Underpants, the hero of their hand-drawn comic books, enters the picture. Using a hypnotic ring he’s gotten in a box of cereal, George turns Krupp into the Captain, and the poor fellow tries unsuccessfully to perform super-hero feats. The kids also discover how to turn Krupp into Underpants whenever they wish by snapping their fingers, and reversing the process by dousing him with water. Eventually they decide to keep him as the Captain by giving him an alter-identity as Krupp. Unfortunately, he’s too childish and undisciplined to fill the principal’s role.

He’s also dumb, which leads him to hire as the new science teacher the arch-villain Professor Pippy Pee-Pee Poopypants (Nick Kroll), whose name will give you some notion of the movie’s reliance on the naughty potty humor kids find so amusing. The teacher’s goal is to end children’s ability to laugh by destroying the section of their brains that controls it. He enlists Melvin, who lacks that part of the brain already, to help him. He also intends to take over the town using a giant robo-toilet, which the Captain can’t foil until he’s endowed with real super-powers by some mutated food provided by school cafeteria lady Edith (Kristen Schaal). They do battle, and everything turns out well, though the newly-mellowed Krupp—now in a relationship with Edith—remains liable to turn into the Captain at unexpected times.

The computer-generated animation from the DreamWorks factory is fine and the voice work enthusiastic, and even in the last hour the script by Nicholas Stoller occasionally offers up some bright quips. (When Professor P., armed with a shrinking device, searches for something to compare with tininess, he mentions society’s concern for education.) Most of the better bits, however, are confined to the first thirty minutes, though even there clunkers occur: despite Professor P.’s later remark, for example, the teachers are all depicted as mindless drones, reading out of textbooks and reciting lists of dates and names for students to memorize.

In the last hour, though, mere mixed messages give way to a riot of tedious action featuring the stumblebum Captain, easily the most one-note of all the characters, and Professor P., whose one-liners are for the most part surprisingly flat. This stuff goes on and on, making you wonder whether the material isn’t better suited to the relatively short time span of episodes of a kids’ cable series than a feature-length movie. The die has been cast, though, and the subtitle indicates that this is intended as the first picture in a series that could go on as long as the books have.

After all, the “Captain Underpants” has the ingredients to appeal to every generation of youngsters: antagonism to authority, childhood friendships one never expects to end, and a liking for running around in your underwear, giggling over bathroom humor and playing superhero. While the movie will undoubtedly please the under-eight set, however, older kids and their parents might find their tolerance tested and long for a return of “Big Hero 6” instead.