Ian McKellen, the veteran British thespian who’s received 50 international awards during a 50-plus year career, makes “Mr. Holmes” worth a look.

In this new take on Sir Arthur Conan Doyle’s fictional British detective, Sherlock Holmes, McKellen portrays the master sleuth in 1947. Holmes, in the twilight of his life, confronts tragic errors of judgment he made 30 years before. McKellen’s beguiling characterization of Holmes at age 93 moves from amusing to muddled to poignant.

McKellen and the director of “Mr. Holmes,” Bill Condon, previously collaborated for 1998’s “Gods and Monsters.” Their new project is a lesser movie but also a companion piece for it. In the almost mystical biopic “Gods and Monsters,” McKellen plays James Whale, director of the classic 1930s horror films “Frankenstein” and “The Bride of Frankenstein.” Like the aged Holmes in “Mr. Holmes,” the once-powerful Hollywood filmmaker is long past his glory days.

And both Holmes and Whale are haunted by memories. The detective’s memories compel him to revisit the troubling case that drove him into retirement. Although Holmes’ failing memory hinders his investigation, guilt and regret push him onward.

The case involved a husband and his wife, a woman who grieved obsessively over the children the couple might have had if she hadn’t experienced two miscarriages.

“Mr. Holmes” shows the past and the present through not-so-well managed nonlinear storytelling. There’s the increasingly feeble Holmes living by the sea with his housekeeper and her young son. There’s also Holmes in the late 1910s, the legendary detective who investigates the unusual activities of Thomas Kelmot’s wife, Ann. And there’s Holmes’ just-completed post-World War II journey to Hiroshima, where the effects of the nuclear bomb are fresh on the ashen landscape and the faces of survivors.

The humor, gravitas and vulnerability McKellen communicates as Holmes receives fine support from Hiroyuki Sanada as Mr. Umezaki, a Japanese man who has a secret agenda, and Laura Linney as Mrs. Munro, the plain and practical housekeeper who fears that her young son, Roger, has grown too fond of the old detective.

Milo Parker plays Roger, the precocious boy Holmes takes a grandfatherly interest in. Holmes and Roger, both of them with unusually bright intellects, are well matched. And actors Parker, a 12-year-old appearing in his third film, and McKellen share warm on-screen rapport, like an old master and his favorite apprentice.

“Gods and Monsters” won Condon an Academy Award for best adapted screenplay, but he didn’t write “Mr. Holmes.” With a script by Jeffrey Hatcher, “Mr. Holmes” is less elegant than “Gods and Monsters.” Too many details cloud the storytelling.

“Mr. Holmes,” a story about an old man striving to make the best of the remains of the day, succeeds most of all through forceful performances by McKellen, Linney, Sanada and spunky junior cast member Parker.