Justin Timberlake's son "shaped" his hit single 'Can't Stop The Feeling'.

Justin Timberlake at San Diego Comic-Con

Justin Timberlake at San Diego Comic-Con

The 35-year-old singer-and-actor wrote the disco-tinged track for the upcoming 'Trolls' film - in which he voices the character Branch.

Justin admits his 15-month-old son Silas - his child with wife Jessica Biel - has given him a different insight into the world since he was born and that has influenced his songwriting.

Speaking at the San Diego Comic-Con event, Justin said: "I'd be leaving out the whole truth if I didn't say having him shaped what the song actually is. [Having a child] gives you a different insight. It's like 'The Matrix,' man. You open a door and there's this whole other world on the other side of it. And you look back through the door at the other world and you're like, 'What was I doing there?' "

Justin was at Comic-Con to promote DreamWorks film 'Trolls', which is based on the popular range of cute long-haired troll dolls created by Thomas Dam which have been popular in the 60s, 70s and 90s.

Justin has produced the soundtrack to the computer-animated movie and admits he drew on influences from the 1970s to create the album which features covers of classic disco tunes by artists such as Earth Wind & Fire, and his own track 'Can't Stop The Feeling' was a love letter to the era.

He said: "The filmmakers say they were inspired by the two sides of the 70s, the two different worlds this movie exists in. So I said let's make a song that sounds like it could be from the 70s, but make it modern. Nothing was out that sort of sounded like that, and it just felt like it was perfect for the movie."

'Trolls' also stars Anna Kendrick, Zooey Deschanel, Russell Brand and James Corden, and is due for release in November 2016.