Whose idea was it to turn those latter day Caribbean pirates Johnny Depp, Bill Nighy and (director) Gore Verbinski loose on a cartoon, ostensibly for kids?

Because “Rango” requires some explanation. It is funny, inventive and downright daft. At times.

But who is it for, what is it and most pointedly — what is the point?

Many’s the movie fan who would pay to watch/hear Depp riff on “ACTING” in a twisted opening monologue. He carries an umbrella drink umbrella and wields a sword usually reserved for spearing the lime in your gin and tonic.

“Acting is RE-acting,” he bellows. “The audience thirsts for adventure. The hero cannot exist in a vacuum.”

Well, it’s a terrarium actually. Not a vacuum. And the Depp delivering this monologue on the stage is a lizard en route to his owner’s new home. Terrarium and lizard tumble out of the car and into the desert, where the reptile gets some instant life lessons/stay alive lessons from assorted desert creatures — a squished armadillo, among them.

And a mariachi chorus of owls croon about his future “untimely death.”

Our intrepid lizard stumbles into Dirt, a desert hamlet inhabited by tortoises, owls, crows, moles, other lizards and the like. The town is dry — no water. Some skullduggery is afoot. So when the lizard takes the name “Rango” and starts passin’ himself off as the rootin’est, tootin’est varmint ever to roam the Old (New) West, they name him sheriff. Both Rango and the good gophers and gopher tortoises of Dirt get more than they bargain for.

Rango runs afoul of the mayor, voiced by Ned Beatty, the villain of “Toy Story 3.” Rango flirts with Miss Bean (Isla Fisher) and wonders, wonders wonders about the missing water.

Depp fills the soundtrack with chatter that sounds so off the cuff it’s as if they put him in front of a mike and 3D animated a movie around his mutterings. Some of that must be true, as the film’s soundtrack was performed like a play by a cast almost fully assembled in the studio at the same time.

John Logan (“The Last Samurai,” “The Aviator”) is the credited writer, and scores no points for coherence. He’s right at home with the occasional “Son of a…” and sneaking in a Hunter S. Thompson joke (Depp played the druggie journalist in “Fear and Loathing in Las Vegas”) or a Man With No Name cameo

But what animated children’s movie that you can think of has a character shout, “Go to Hell!” at a villainous snake? It doesn’t matter that the snake (voiced by Nighy) answers “Where you do think I came from?” Fitfully amusing or not, the whole demented enterprise of “Rango” comes into question when you’re that tone-deaf about what’s appropriate for children.