Writer and comedian David Walliams confessed he still has imaginary friends as he told how he finds inspiration for his children’s books.

The Little Britain star recalled how he used to transform his childhood bedroom into a spaceship where he could write his early material.

Describing himself as a “solitary child”, the 46-year-old told Radio Times magazine of his make-believe companions: “They’re still my friends – they’re not imaginary, are they?

Investitures at Buckingham Palace
David Walliams was awarded an OBE for services to charity and the arts (Philip Toscano/PA)

“I really liked being alone with my imagination and my toys, creating comedy sketches. I used to think that my bedroom was a spaceship and I could pilot it out into space at night.

“Your imagination is formed as a child and I think writers tend to be more solitary as children.”

After turning his attention from TV roles, such as sketch show Little Britain with Matt Lucas, to creating novels for young readers, he has penned more than 10 titles.

“I never set out to write a masterpiece,” he said.

“Some writers can’t get started because they want to be the next James Joyce. I don’t worry too much about that. My books are there to entertain kids; everything else is a bonus.”

He said each book takes him three to four months to write and he draws inspiration from real-life characters, whether he meets them in his daily life or welcomes them on stage as a judge on ITV contest Britain’s Got Talent.

Commenting on his fifth novel, the comically gruesome tale of Ratburger, he said: “The character of Burt is based on a Britain’s Got Talent contestant who ate live cockroaches from a paper bag.

“He got me thinking – if he eats live cockroaches, what else might he do? Might he turn rats into burgers? Might he sell those burgers to kids outside schools? That was the first little seed.”

But commenting on his recent release, Bad Dad, he admitted that he was disappointed by critics who slammed the inclusion of a gay wedding scene.

“What a shame,” he said.

“My best friend from school is gay and I was best man at his wedding – my son was the ring-bearer.

“There were lots of children there, and I thought what a wonderful thing that these children will grow up without any sense of prejudice against gay people. I don’t think children reading it will be the least bit bothered.”

Radio Times.
Radio Times out now (Radio Times/PA)

:: Radio Times is out now.