Vanessa Hudgens at The Accelerated School

As kids across the U.S. head back to school, Vanessa Hudgens certainly can relate. The actress remembers vividly the routine she followed at the start of the new academic year and the one ensemble that stuck out in her mind.

“It was literally polyester shorts with a matching button-down T-shirt that had fish on it,” she said, sitting near the main office of The Accelerated School in South Central Los Angeles on Wednesday. “I remember I would set out my clothes the night before. So I woke up, had everything set and ready to go. It was very overwhelming for me because I was a really shy kid. I was kind of scared going back to school because I had to be around everyone.”

From her breakout role as the scholastic-minded singer in “High School Musical” to more mature parts in “Spring Breakers” and “Grease Live!,” Hudgens has had several chances to calm any school-related jitters. On this particular morning, after a summer of fun that included a jaunt to Outside Lands music festival in San Francisco, she teamed with Kohl’s and Adopt a Classroom to hand out new Nike sneakers to 1,800 students and present $600 checks to the teachers at the charter school. “I am the fairy godmother today,” she said.

The 27-year-old was also full of advice, academic and style-wise. “I wish that I was more patient in school,” she said. “I think that when you’re learning something in school it’s frustrating and it’s challenging and it’s easy to give up. But if you are patient and stick it through and put in the work, you’ll end up so much better than you began.”

Outside of the classroom, she suggested that youths not be afraid to take risks with their wardrobe. “If you think something is cool, then rock it, own it and don’t let other people’s opinions derail you from how you want to express yourself.”

Hudgens was about to put her words into practice. About a third of the Panthers student body sat on the floor of the gymnasium, eagerly awaiting their surprise guest. Johnathan Williams, the charter school’s founder, told them, “We’re kicking this year off on the right foot.” Once he hinted at “High School Musical,” the students released a loud gasp. The doors opened to the sight of Hudgens jumping onto the basketball court in black and white Nikes that matched her leggings and polka dot shirt knotted at the waist.

When the excitement faded, Hudgens told the students wearing white and blue polo shirts, “It’s important to write down your goals and dreams. You can be anything, whatever you want to be, a doctor or go to the moon.”

Ashley Maganda and Andrea Gonzalez, both 10, couldn’t believe their good fortune. “We had no clue,” said Gonzalez, who picked pink and blue kicks while Maganda selected pink Nike Shox.

Hudgens told them and their classmates that “you guys are starting the year better than me. I never got any free sneakers.”

The girls took their idol’s words home with them. For Maganda, who wants to swim and be a teacher, Hudgens penciled an autograph with three words of encouragement: “follow your dream.”