Picture “Raging Bull” with a sleazy prep from the Brooklyn hipsteropolis of Williamsburg, and you’ll get the idea of “The Comedy,” a character study that tries to make the revolting compelling.

A fully committed Tim Heidecker plays Swanson, an entitled, rude, potbellied slacker who stands to inherit a massive fortune when his father, who is hospitalized and near death, slips away. In the meantime Swanson floats around on a boat in the East River, does some blue-collar slumming à la Jack Nicholson in “Five Easy Pieces” and harangues everyone near him with filthy monologues about whatever seems least appropriate at the moment. Here he is professing admiration for Hitler; there he goes telling a waitress he’s a convicted rapist.

Swinish as this character is, his gonzo alienation can be funny in the way of an outlaw comic as you await his next outrage against all decency. But Heidecker is no Nicholson, and the character lacks the magnetism of a true antihero. Moreover, the film’s hints that Swanson’s problem is mere sadness at the passing of Daddy seem facile.