The former Disney star, 32, returned to the city for the third instalment of Netflix romantic comedy The Princess Switch, in which she plays three different characters.
Hudgens, best known for starring in High School Musical, said lockdown measures meant the funfairs and festive markets were absent on her return.
She said: “This is the second time that we filmed in Scotland over the holiday season, which is just magical because Scotland is a magical place.
“I was in the city centre in Edinburgh, and the first year it was absolute magic because next door there were Christmas markets and rides and all the things that are Christmas that you could ever want, and it really just made the entire experience feel so magical.
“But this last year, with the pandemic, there was no Christmas market and that spirit of Christmas that I fell in love wasn’t really in the air.
“It was a tough time for everyone and I feel very blessed and fortunate to be able to do this movie at a time where we all need comfort.”
It’s not the first time Hudgens has spoken of her love for Auld Reekie.
Speaking on American talkshow Live with Kelly and Ryan last year, she admitted to have an "obsession" with the city – though admitted that she struggled to pronounce its name at first during filming.
“I had to say the name of the place in the movie, and I had to ask ‘how do I say the name of the place that we’re in?” She said.
“It looks like Edin-burg but you can’t say it like that. Edin-brah is where I landed.
“I was so obsessed with it - it’s the place that I never knew I had to be at. It’s literally like Harry Potter come to life.”
In January, Hudgens posted some videos from Edinburgh on social media while she was staying in the city.
She posted two videos and captioned one ‘Morniggg’ from Gilmerton Road and the second with ‘Sunrise in Scotland’ as she explored the city.
The star had been staying in a suite at the plush Balmoral Hotel estimated to be costing around £1,600 a night.
On previous visits, Hudgens had shared pictures of her exploring Cockburn Street and rolling down a hill with Arthur’s Seat in the background as walkers strolled by.
Hudgens played dual roles in the original 2018 film The Princess Switch – Duchess Margaret and baker Stacy – who realise they look identical and switch places.
The sequel to the Christmas movie added a third lookalike, Margaret’s evil cousin Lady Fiona, who attempted to steal the throne.
Hudgens – whose credits include Sucker Punch and Spring Breakers – has been in the Hollywood spotlight from a young age and admitted this has been a challenge throughout her life.
“Being yourself is hard enough as it is, to have full self-acceptance and full self-love. But then you add on the entire world looking and it gets sticky,” she said.
The Princess Switch 3: Romancing The Star is available to watch on Netflix now.