In Harry Potter and the Goblet of Fire, Robert Pattinson portrays Cedric Diggory, a student from the rival Hogwarts School of Witchcraft and Wizardry. The film follows Harry Potter as he competes in the Triwizard Tournament, a dangerous magical competition. Pattinson's portrayal of Cedric Diggory showcased his acting skills and helped him gain recognition in the film industry.