Ben McKenzie grew up in Texas and became famous at 24 for playing a moody young Californian on “The O.C.” Now that he’s starring in Fox’s “Gotham” as Detective James Gordon, future friend of Batman and the only good cop in Gotham City, it feels as if he’s new to New York.

But there’s a drab building on Ninth Avenue that he called home for a year during his brief I’ll-be-your-server-tonight phase, and on a recent morning he stands in front of it looking acutely embarrassed while a reporter repeatedly buzzes his former fourth-floor walk-up.

The situation highlights several traits of Mr. McKenzie, who at 36 has already been the leading man in three successful television series (including “Southland”). He’s a good sport. He’s unassuming, showing up early for an interview, with no handlers, and waiting patiently on a Hell’s Kitchen sidewalk. And as a former high school football player, he can take a hit: His forehead sports an ugly, purple, two-inch gash, sustained the day before when a fight scene got too vigorous, and his head hit a pillar.

“Gotham” is filmed at Steiner Studios at the Brooklyn Navy Yard and on location around the city, and Mr. McKenzie, back in New York after more than a decade, is now living comfortably in the East Village (a neighborhood he admits he found a little intimidating in 2001). But he remembers well the feeling of sharing a tiny room with bunk beds, of waiting on tables and doing data entry, of trying to find work just as the Sept. 11 attacks battered the downtown theater scene. There were times when following the footsteps of his father, a prominent Austin, Tex., lawyer, seemed like a good idea.