Speaking at the Cannes Lions International Festival of Creativity yesterday, McKellen explained that as soon as he came out as gay it had a great impact on his career because he starting being himself.
The Lord of the Rings star said: "You have to be honest or there’s no point in being an actor. My acting became about revelation and honesty."
McKellen explained that he got into acting because he felt it was a way of expressing himself. He said: "Society didn’t allow me to express myself fully but when I was acting I could, and I heard you could meet other gay people."
He also said that he often visits schools to speak to young people about being LGBT and has found that they are very open minded. However, McKellen added that the younger generation do not like being labelled.
"The next generation doesn’t want to be in a group," he said.
McKellen was on stage with Jackie Stevenson, founding partner and global managing director of The Brooklyn Brothers, and Gary Reich, founder and managing director of production company Brown Eyed Boy.
They launched a project to portray LGBT people as heroes and have created a number of short films with a gay superhero, for instance. The trio are looking for backing from brands to fund the films.
Stevenson explained that brands and media owners need to stop portraying being LGBT as a struggle and called for advertisers to "come out of the closet".
Reich, who produced Vicious, the ITV show about a gay couple and featured McKellen, spoke about his own experiences of coming out.
He said that when he grew up in South Africa he did not have any gay role models until he saw Boy George on TV.
Reich added: "Then 20 years later in London I met George and he became a friend, and I said, ‘you once saved my life,’ and he said, ‘you have to do the same thing with your work, somewhere there will be a 13-year-old who feels the same’.
"That’s the point of art, it can genuinely save a life. So I do believe there’s a lot we can and should be doing."