Jake Gyllenhaal (L); Brad Pitt.Photo: Mark Sagliocco/Getty; Chris Pizzello-Pool/Getty

Jake Gyllenhaal, Brad Pitt

Speaking withW Magazinefor their 2022 Best Performances Portfolio, the 41-year-old actor recalled first meetingBrad Pitton the set ofThe Good Girl, which Gyllenhaal worked on with Pitt’s then-wifeJennifer Aniston.

“I was working withJennifer Aniston, who was his wife at the time, and there were a lot of racy scenes,” saidThe Guiltystar. “I remember putting my hand out to shake his, and accidentally hitting the door.”

But Pitt, 58, “said, so confidently and kindly, ‘Well, you have another one. It’s all right.’ "

“It was a really lovely exchange, but I was definitely starstruck,” Gyllenhaal shared.

Never miss a story — sign up forPEOPLE’s free daily newsletterto stay up-to-date on the best of what PEOPLE has to offer, from juicy celebrity news to compelling human-interest stories.

Jake Gyllenhaal forW Magazine.Tim Walker for W Magazine

Jake Gyllenhaal

Gyllenhaal previously recalled working with theFriendsstar on the 2002 film during an interview onThe Howard Stern Showthis past October.

WhenHoward Sternasked him if it was"torture” to film love scenes with Aniston, 52, Gyllenhaal said yes because he liked her so much.

“Oh yeah, it was torture, yes it was,” he said, laughing. “But it was also not torture. I mean, come on, it was like a mix of both.”

“Weirdly,love scenes are awkward, becausethere are maybe 30, 50 people watching it? That doesn’t turn me on,” Gyllenhaal added. “It’s oddly mechanical. And also it’s a dance, you’re choreographing for a camera. You can get in it but it’s like a fight scene, you have to choreograph those scenes.”

RELATED VIDEO: Rumer Willis Opens Up About the Last Time She Was Starstruck

In April 2016, Gyllenhaal joked to PEOPLE that working with Aniston was “rough.”

“I will say, I had a crush on her for years. And working with her was not easy,” he said of making the film with Aniston when he was 22. “I was – um, yeah. That’s all I’m going to say. It was lovely. It wasn’t hard, that’s what I would say.”

Gyllenhaal added that it wasn’tFriendsthat put him on TeamAniston, but the way the actresspresented herself.

“Not so muchFriends, but kind of her personality from afar, and movies she was in,” he said. “And some ofFriends– I’m not a hugeFriendsfan – but who she is.”

source: people.com