Hamill was on campus to participate in a ceremony for the university's Neighborhood Academic Initiative. The program provides college scholarships to students from some of the low-income neighborhoods near the campus.
Starting in sixth grade, students and their families participate in a series of classes and programs to help them prepare for college. Those who stick with the program for seven years through their high school graduation are eligible for four-year scholarships to the University of Southern California if they meet admission requirements.
Nearly 1,000 students have graduated through the program since 1997. Of those, 398 were accepted to USC. This year alone, 22 are going to USC with full rides.
Many students in the program will be the first in their families to attend college.
Nathaniel Nevels said he was recommended for the program by a teacher. "She saw something in me I had yet to see in myself. So after being in the program I saw the opportunities that are ahead."
The NAI event happened to fall on May 4, also known to sci-fi fans as Star Wars day - as in May the Fourth be with you.
Hamill, wearing a dark, almost Jedi-like suit, was marched on campus in the custody of a phalanx of stormtroopers and Darth Vader.
The actor, whose daughter Chelsea graduated from USC, has participated in other campus events over the years, including previous NAI ceremonies and a marching band performance in 2015.
Also part of Thursday's ceremony was ABC7's Alysha del Valle, serving as MC, and actor Tom Kenny, the voice of SpongeBob SquarePants.