It took a little bit of work for Ewan McGregor to get back into character for his new “Star Wars” series.

On Tuesday, the actor sat down with Jimmy Fallon on “The Tonight Show” to talk about returning to the franchise for “Obi-Wan Kenobi” and revealed what it was like acting opposite the villainous Darth Vader.

READ MORE: Ewan McGregor Passionately Defends The ‘Star Wars’ Prequel Movies: ‘I Like Them’

“It was frightening to see him again though. I hadn’t acted with Darth Vader,” he said. “And I’ve been acting a long time. I think I’ve done a lot of stuff. But the first take with Darth Vader scared the s*** out of me.”

He explained that, as they were rehearsing, co-star Hayden Christensen didn’t actually have his Vader helmet on.

“And then they went, ‘Action!’ And I’m walking down and I hear something, I turn around and f**k, Darth Vader is coming at me. I swear to God, I just about s**t my pants, really,” McGregor said.

“When you’re a kid, that is probably one of the scariest villains you’ll see,” Fallon told him.

“That’s it, I think… I was like seven years old again. It was really genuine fear,’ McGregor said. ‘I’ve made horror films and stuff. They’re not frightening, but that was,” McGregor recalled.

The actor also described the difficulty of getting his old Obi-Wan accent back, which had been inspired by the voice of Alec Guinness, who played the character in the original “Star Wars” film.

“I went to this dressing room, and there was this sort of Obi-Wan-esque costume, you know. Sort of cobbled it together and I put it on and that was sort of breathtaking after 17 years, looking in the mirror,” McGregor said.

READ MORE: Ewan McGregor And Hayden Christensen Talk Returning To The ‘Star Wars’ Universe In The New ‘Vanity Fair’

“But then I went on and I started reading with these other actors, and I totally didn’t have his voice at all. It was really bad,” he continued. “I was just sort of doing this vague English accent and it didn’t sound at all like Obi-Wan Kenobi.”

Finally, things worked out, as McGregor explained, “I just had to go back and like watch lots of Alec Guinness movies and watch all the original films. I got back into it. It was good, it was really good fun.”