It's ridiculous that I've gotten to play both Gandalf [in the Lord of the Rings films] and Magneto [in the X-Men films]. How did that come about?
One would have been enough. But two? And [it] also nearly might not have happened.
I got offered a part in Mission: Impossible II with Tom Cruise, but they wouldn’t let me see the whole script because I might have spilled the beans. I only got my scenes.
Well, I couldn't judge from reading just those scenes what the script was like. So I said no. And my agent said, "You cant say no to working with Tom Cruise!" and I said, "I think I will."
The next day, Bryan Singer asked me to play Magneto and then Peter Jackson asked me to play Gandalf, and I said yes to both.
RELATED: Ian McKellen Delivers a Gandalf-Inspired Speech
Then, Bryan Singer's first X-Men overran its preparation. It had to delay, delay, delay, delay. So I had to call up Peter Jackson and say, "I'm sorry. I can't play Gandalf because X-Men, which I agreed to do first, is overrunning."
And Peter Jackson said, "Well, I'll keep it free for you. Let me know what happens." I told Bryan Singer and he said, "Well, you must do Gandalf. I'll make sure you get out in time."
And he did – with three days to spare.
Meanwhile, Mission Impossible was put off, put off, put off. And if I had decided to do that, I wouldn’t have been in X-Men and I wouldn't have been in Lord of the Rings.
It's all about luck – being there at the right time and ready for it.
You can't prepare for luck. I've learned that you've got to be ready for the luck when it arrives, but you're going to need the luck.
For more from McKellen, pick up the latest issue of PEOPLE, on newsstands now