M. Night Shyamalan, writer and director of “The Sixth Sense,” has followed up that breakthrough film with one that is a mere shadow of it in some ways, but a little better than it in others.

“Unbreakable” is a darkly exhilarating story about David Dunn (Bruce Willis), a Philadelphia security guard whose marriage is on the rocks and who is considering a move to New York. On the way back to Philly after a job interview, his train wrecks. He’s the only survivor — and, what’s more, he doesn’t have a scratch on him.

Enter Elijah Price (Samuel L. Jackson), a man with a brittle-bone disease that makes him the opposite of the seemingly “unbreakable” David Dunn. Elijah has spent many hours in hospital beds with nothing to do but read, and has so become a comic book aficionado. Seems it’s gone to his head, too: He thinks the reason David wasn’t hurt — and indeed, the reason David can only recall having been injured once in his life — is that David has super powers.

It’s a laughable idea, and the plot as described so far would make a fine comedy. Amazingly, however, Shyamalan plays it very straight, though he allows his trademark deadpan humor to lurk around the edges — and it works. Just as “The Sixth Sense” managed to be a horror movie that gained legitimacy by also being a touching psychological drama, “Unbreakable” is essentially a superhero movie that goes deeper than men in tights flying around and saving the world.

“The Sixth Sense” — to which this will inevitably be compared, so I’m not going to fight it — was a more impacting film, thanks largely to Haley Joel Osment’s extraordinary performance and the movie’s intrinsic poignancy. “Unbreakable” is a lot more inconsequential than that, though its themes about a person’s place in society and calling in life are interesting, as is David’s relationship with his wife (Robin Wright Penn) and its parallels to his personal journey.

“Unbreakable” is probably better-filmed than “The Sixth Sense” was, as Shyamalan — obviously trying to be the antithesis of what you’d expect from a superhero movie — uses few cuts from one shot to another. The camera will either sit there or move from one character to another, often for minutes at a time, bringing the audience right into the scene, as it feels like we’re an observer standing next to the action. The pacing is methodical and unrushed; much of the film is quiet; and yet it doesn’t feel slow or dull.

“The Sixth Sense” suffered a little from people who had heard there was a twist and who watched it with that in mind, hoping to figure it out themselves. If you’re going to watch either that film or this one with a goal like that in your head, you’re going to miss out on what the movie has to offer. There either is or isn’t a twist at the end of “Unbreakable”; just watch it and see.

I will say this, though: The only downfall this movie suffers is in its last 20 seconds. The movie is over, essentially, and then title cards appear, telling us what became of the characters. This nearly destroys what Shyamalan has very beautifully established; a far more effective conclusion would have been to leave things hanging. It’s hard to believe that 20 seconds of a movie could do so much damage, but that’s what these 20 seconds do. And maybe it shouldn’t surprise us. This is the filmmaker, after all, who is famous for pulling the rug out from under audiences. Too bad he used that power for evil this time, instead of good.

B+ (; PG-13, very mild profanity, one crude sexual reference, some scary violence.)