If you wonder why Gene Wilder often sounded sour about Richard Pryor, think about how great they were in “Trading Places.”

You’re right. They weren’t in the 1983 flick. But they were supposed to be the stars from the get-go.

“The script was developed for Gene Wilder and Richard Pryor,” director John Landis told Business Insider in 2013. “And when I was sent the script, Richard Pryor, unfortunately, had his accident where he burnt himself rather badly.”

So Pryor’s role went to budding star Eddie Murphy, sparking further retooling that put Dan Akroyd in Wilder’s slot. The movie ranked fourth in ticket sales that year, raking in $90 million — and to this day retains its pop and humor.

And that was one of the smaller slights to Wilder at the hand (or misbehavior) of Pryor, the Peoria native who has been gone since 2005. Wilder died Monday at age 83.

While the two made America laugh, Pryor made Wilder miserable.

“We were never good friends, contrary to popular belief,” Wilder once said. “We turned it on for the camera, then turned it off. He was a pretty unpleasant person to be around during the time we worked together. He was going through his drug problems then and didn’t want a friendship outside of what we did on the screen.”

The pair made four movies together, starting with “Silver Streak" and "Stir Crazy." When the latter came out in 1980 — "That's right, we bad, uh-huh" — they were as hot as anything in Hollywood in a long time.

Meantime, when dutiful and sober, Pryor could talk them up well, such as when they did an interview in 1976 with Roger Ebert to promote “Silver Streak.” Impressed by their camaraderie, the critic gushed, “Pryor and Wilder make a good team, Wilder with what he calls his ‘low-key high energy,’ Pryor with his apparent ability to con anybody out of anything.”

But Pryor couldn't always keep his tongue or actions in check, not with cocaine ruling his world. In a coke-fueled interview on the set of “Stir Crazy,” one that came to light just a few years ago, Pryor — whom biographers later would say just didn’t like Wilder — praised Wilder as a ladies man (“I never got [women] before Gene Wilder”), then turned nasty and disparaged his sexuality.

That kind of unpredictability grated on Wilder. As Wilder recalled in 2013, according to the Stamford Advocate, “Then we did `Stir Crazy' and Richard was a bad boy. He would come to the set 15 minutes, 45 minutes, an hour, an hour and a half late and it would bug all of us. I didn't want to say anything because I wanted it to go on."

Not long after the release of “Stir Crazy,” Pryor nearly killed himself with freebasing and fire. But in 1989, the pair got together again to do “See No Evil, Hear No Evil.” Pryor was “an angel” during shooting and they improvised well, Wilder recalled in 2013. But two years later, for “Another You,” Pryor was having his old problems and the film foundered, Wilder said.

Long before that, there should have been one more movie in the Wilder-Pryor oeuvre — a great one. Pryor, who cowrote 1974’s “Blazing Saddles,” was supposed to co-star. But his drugs and mischief scared Hollywood. Despite director Mel Brooks’ pleas in support of Pryor, the role went to Cleavon Little, and the movie became a classic.

But that was Richard Pryor, a comic genius who never reached his potential. And no one knew that more than Gene Wilder.

PHIL LUCIANO is a Journal Star columnist. He can be reached at pluciano@pjstar.com, facebook.com/philluciano and (309) 686-3155. Follow him on Twitter.com/LucianoPhil.