It's 1994, and Mayor Rudolph Giuliani is about to do something radical in New York, something no one quite knows what to make of. He's about to enforce the law. This is distressing to Luke, the young hero of "The Wackness," who feels his livelihood could be threatened. It's the summer before college, and Luke is spending his days peddling marijuana from an Italian ice cart.

"The Wackness," from writer-director Jonathan Levine, is a coming-of-age story with ambitions to capture a moment in time and an attitude. Levine wants to tell a story about a young man's romantic awakening, but he also wants to re-create the feeling of the old (pre-Giuliani) New York in its last days. He wants his audience to feel the excitement of the era's hip-hop, when Tupac was flourishing and Notorious B.I.G. was emerging. Levine tried to make that movie, but he made something less than that.

For all Levine's intentions, which are clear, very little New York feeling actually comes through his story, nor does a hip-hop consciousness ever really make itself felt. The period details remain just glancing touches, and the big emotions associated with them remain locked in the filmmaker's soul and inspiration. Maybe if you were there, in New York, and you were 18 in 1994, you might appreciate a reference or two or a song on the soundtrack, but in every way that matters, "The Wackness" could have been set in any year from 1968 to 2008. It tells a universal story, about a boy and a girl, and it's occasionally moving and occasionally fraudulent but always, to its credit, fundamentally sincere.

Levine himself was 18 in 1994, and "The Wackness" has the feel of a beefed-up recollection, a mix of things that happened, things that sort of happened and things added for the sake of extra drama. Luke's identity as a drug dealer, for example, rings both fictional and false. Not only does he hardly seem the type, but Levine makes little dramatic use of the drug element. The detail might be there to add color and to grab interest, but it's of ultimately little consequence to the story.

The opening scenes are weak, but the movie gets better. The pre-credit and credit sequences present Luke (Josh Peck) as a pot-selling mope with an old drug addict for a psychiatrist (Ben Kingsley), and at first the movie looks as though it's going to be a lugubrious wallow in the angst-ridden misery of an unappealing kid. Everyone is depressed. Rooms are dark. The city looks gloomy. Only with a lot of effort could Levine have made the beginning of "The Wackness" less promising.

But then Luke meets a girl, and life picks up, he brightens up, and so does the movie. She's Stephanie, the stepdaughter of his psychiatrist, and she's played by Olivia Thirlby with a combination of warmth and elusiveness, the nonchalance of the one who gets away but is remembered forever. These young love scenes are the best in the movie. Levine is in command of what he wants to say, and for once the character of Luke is activated. It's hard to make a movie about a phlegmatic protagonist and usually not a good idea.

Levine wanted to create an overall sense of New York in this period, because he wanted to tell a story bigger than Luke's, about cultural shifts that have their analogue in private life. But the connections between the political and personal are never clear, and the story of the drug-addled psychiatrist and his difficult marriage to a younger woman (Famke Janssen) neither feels real or true nor carries any emotional heft, despite Kingsley's efforts.

Still, when "The Wackness" is good, it's good, and when it fails, it's still clear what Levine was trying to do. Someday he'll probably be able to do it.