Reilly honed his improv skills by making some impromptu home videos with Anderson and Hoffman.

Paul Thomas Anderson directed John C. Reilly and Philip Seymour Hoffman in “Hard Eight,” “Boogie Nights,” and “Magnolia,” all of which were released to critical acclaim in theaters, but it turns out a secret fourth collaboration exists. As part of Reilly’s GQ cover story interview, the actor and Anderson looked back at filming surprise home videos featuring Reilly improvising opposite Hoffman. Surprisingly, the idea was born out of their shared love of “Cops.”

Reilly and Anderson formed a close friendship after being paired at the Sundance Director’s Lab, which gave way to the director’s feature debut “Hard Eight.” Anderson said he was “as big a fan as you can be of somebody who’d made five movies” when he was first brought into contact with Reilly. “He didn’t look like anybody, he didn’t sound like anybody else. And that was really exciting,” the director said of the actor.

During the summer the two spent waiting for funding to come in for “Boogie Nights,” they bonded even more over their love of the reality series “Cops.” Anderson told GQ he would talk on the phone with Reilly during episodes and came to the conclusion that Reilly looked like a cop after he shaved off his goatee. Anderson realized what had to happen next: “If you’ve got nothing else to do, take a video camera and drive around.”

“[Anderson] got me in an L.A.P.D. uniform from a costume friend, and we would drive around,” Reilly remembered. “We’d call up, like, Phil Hoffman and say, ‘Phil, we’re coming over. Someone called the police because your music was too loud. Just go with it. You’ll see when we get there.’”

When the two arrived at Hoffman’s apartment, Anderson had the camera rolling as Reilly launched into an improvised scenario as a cop. “I would be like, ‘Apparently’—and I had the Oakleys on—‘this individual thinks they can play their music however loud they want. Well, I got news for them. There’s a thing called the law,'” Reilly said.

Reilly’s performance as the cop would inspire Anderson to write him a similar character in “Magnolia.” Anderson said Hoffman would get in on the improvisation, faking a heart attack and cursing in one scenario. “It was really, really, really, really, really, really fun,” Anderson said.

The three would go on to make “Boogie Nights” and “Magnolia,” with Hoffman also starring in Anderson’s “Punch-Drunk Love” and “The Master.” Head over to GQ to read more from Reilly’s profile. The actor can next be seen in a lead role in “The Sisters Brothers.”