Ryan Gosling surprised his Barbie co-stars by sending a Scottish bagpipe player to their sleepover.

During a phone call with GQ, Barbie director/co-writer Greta Gerwig told the story of when The Notebook star sent a Scottish man to play the bagpipes and recite the speech from Braveheart at a sleepover.

The Little Women director explained that she and Margot Robbie, Barbie lead actress and producer, hosted a sleepover for the actors playing the various Barbies in the movie, and invited the various Kens to drop by. Gosling was unable to attend so he made up for his absence by sending an unusual gift midway through the sleepover.

"This man, this Scottish man in a full kilt, showed up and played the bagpipes," Gerwig explained. "Then he read a speech from Braveheart. And then he left."

Gerwig added that Gosling "always can sense very quickly what would be the most delightfully funny thing to do next. And then he does it."

In the 1995 movie, Mel Gibson gives a speech as Scottish warrior William Wallace, who tells his armies that the English may take their lives, but they'll never take their freedom.

When asked why he picked the Braveheart speech, the Canadian actor simply stated, "Well, sometimes, you just need to hear it."

Barbie is released in cinemas on 21 July.