By JOCELYN NOVECK AP National Writer

Take two charismatic actors. Give them characters that are, on the surface, totally incompatible. Plunk them into your basic whodunit, a mismatched team fighting fill-in-the-blank bad guys. Stir in some shoot-em-up action, and poof: You have a buddy cop movie, one of the most durable formulas in Hollywood.

Now, technically, Ryan Gosling and Russell Crowe don’t play cops in The Nice Guys, by writer-director Shane Black (who knows a thing about buddy cop movies, having written Lethal Weapon back in 1987.) One’s a bumbling private investigator, the other a low-life hired enforcer. But the equation’s the same, and like a buddy-cop movie (or a porn film – more on that later) the important thing isn’t the plot. It’s the chemistry.

Gosling and Crowe do have chemistry, and an obvious sense of humor which gets them far. They’d have gotten farther, though, if the movie, while at times hilarious, didn’t have such an uneven feel, particularly a nasty edge that simply clashes with the desired jocular tone. Yes, there’s such a thing as dark comedy, but this is a comedy that occasionally just makes you feel queasy. There were moments I knew I was supposed to be laughing but found myself scribbling in my notes: “hmm, funny but not?”

Then again, there are some inspired moments, such as when enforcer Jackson Healy (Crowe, paunchy and amiably violent) tracks down Holland March (Gosling – sweet, clumsy, effortlessly funny ) in a men’s room stall. March is understandably wary, considering Healy had broken his arm at their last meeting, leaving him howling on the kitchen floor like a wounded cat.

March also has his pants down. Watch Gosling juggle pointing a gun, keeping an annoying stall door open, and hiding his privates behind a magazine. It’s top-notch physical comedy, and you’ll laugh out loud. This has to be one of Gosling’s most entertaining performances.

The plot isn’t easy to explain (or grasp) quickly, but here goes: We’re in 1970s Los Angeles, a city rife with smog, porn stars and ill-fitting suits. In a prelude, a young boy reaches under his parents’ bed to inspect their “Playboy,” featuring naked porn star Misty Mountain. Moments later, the same boy witnesses a horrific car crash in which a dying Mountain herself appears lying just as sexily – and naked – on her wrecked car. (Funny but not?)

What does Misty have to do with Amelia? Thanks for asking, but who knows? Amelia’s a missing young woman that March has been hired to find. But Amelia herself has hired Healy to take care of the guys searching for her. At least one of them is March, which is how he ended up howling on that kitchen floor. But there are bigger forces apparently engulfing Amelia: Corporate greed, and government malfeasance, and environmental activism – stuff like that. Also: Why does everyone involved in Misty Mountain’s last porno keep dying?

Helping March and Healy figure it all out is March’s whip-smart tween daughter, Holly (an appealing Angourie Rice), who keeps showing up when she’s not supposed to. Holly, sort of a Nancy Drew but in an Rrated film, keeps ending up in peril, either to her life or her moral upbringing (the 13-year-old is forced to watch and discuss porn at one point). She’s also a moral compass for Healy, at one point sweetly asking if he’s just murdered a guy lying in the road while she went to get help, because that would be wrong. (Well, at least it gets him thinking.)

It all ends up in an incredibly energetic, chaotic shoot-em-up. It’s fun in a manic sort of way, but it might have been more fun to clear away some of the dust – or smog – and just watch two charismatic pros spar with each other. Maybe in the sequel.