SACRAMENTO, Calif. — After a lousy stint in Minnesota, Derrick Williams felt he improved in Sacramento, which he called “a great basketball town’’ and “great for my career.’’

But the second-overall pick in the 2011 draft still wanted a fresh start in New York. The Kings made him a low priority to re-sign. Knicks president Phil Jackson, with cap space to burn, was willing to take a flier on Williams and his scary potential.

The versatile, 6-foot-8 forward made his Sacramento return Thursday in the Knicks’ 99-97 loss, still unsure how big a role he’s going to have as his new team continued their stumble, falling to 10-14 amid a 2-8 stretch.

There have been definite glimpses of promise, but coach Derek Fisher, mysteriously, has not found enough playing time for the bench sparkplug.

In fact, Williams, who played just six minutes and was scoreless Thursday, is averaging less minutes as a Knick than he did in Sacramento, where he played 19 minutes per night last season.

Entering Thursday, Fisher had played Williams 13.3 minutes per game in his over-stuffed rotation despite his potential as a speed demon who can help the Knicks’ flagging transition game. Williams was averaging 7.2 points in the reduced time and 2.3 rebounds, but his 3-point percentage had fallen to 27.8 percent.

Through 23 games, Fisher didn’t seem sure what he had yet in Williams, the team’s best player in the preseason, who single-handedly won the season opener in Milwaukee. The sign of a good head coach is getting players to improve as the season goes along, but Williams, known to be prone to mistakes, has regressed.

The lowlight of his Knicks stint was a DNP in a loss in Orlando on Thanksgiving eve. This flier was no cheap investment, either. Williams signed a two-year, nearly $10 million deal with an opt out after the first season. If he doesn’t opt out, the Knicks will not have enough maximum cap room to offer Kevin Durant or point guard Mike Conley.

“I haven’t talked to [Fisher] about it,’’ Williams said Wednesday. “It’s his choice. I can’t really argue with the coach’s decisions, minutes and things like that. It comes from the coaching staff. I try whenever I’m in the game, I try to make an impact. That’s the only thing I can do.’’

Williams found his situation in Sacramento wobbly last season, playing for three coaches — Mike Malone, Tyrone Corbin and George Karl. Karl knocked Williams in the press once, chiding him for grabbing zero rebounds in a 20-minute stint. But Williams feels Karl improved him.

“He’s a good coach,’’ Williams said. “He wasn’t really tough like that. That was one game. He expects a lot of things out of me. I think that’s always good, when you have a coach that really expects things out of you, wants to bring out the best in you. Myself and him, we talked about it. It was no hard feelings with the quotes. That happens when a coach expects a lot of you. At the end of the day, he wasn’t too, too hard on me. He wanted the best out of me.

“He’s a great guy. I really thrived under him.’’

Williams said he would talk to Karl — which would be more than he talked to Fisher. Williams has the same agent as Fisher (Rob Pelinka) but doesn’t seem to have a communication flow. After the season, Williams didn’t speak with Sacramento, holding interviews with Dallas, the Knicks and Washington.

He wanted to play for Jackson.

“That was an environment I wanted to be in, a winning environment, you know what [Jackson] brings,’’ Williams said. “Know what he expects. Just growing up, being from Los Angeles, you get that sense, they expect winning. With Phil and everybody being gone out of Los Angeles right now you really feel that. I wanted to come. I wanted to help turn things around. I think I helped with that last year with the Kings as well. We didn’t win as many games as we wanted to, but we really got the fans ready for this season.’’

The Kings have struggled, too, after a busy offseason, signing Rajon Rondo. But star center DeMarcus Cousins is off to a slow start.

“They had a lot of stuff going on,’’ Williams said of their slowness to make him an offer. “I think they were really looking to get a point guard with Rondo. They really wanted to get a point guard. Rondo is one of the best out there. You can’t really turn that down. At the same time, I love Sacramento. It was a great city, great guys to play with as well.’’