"The big reveal that Darth Vader is Luke's father was a crazily guarded secret--even the actor who played Vader didn't know. As most people know, Vader's body was played by David Prowse, and his voice was James Earl Jones. During filming though, Prowse did say his lines. During that scene, what he actually says is "Obi-Wan killed your father." Hamill was only told moments before what the actual line was going to wind up being and none of the other actors knew--no one knew except Lucas, the director, and some producers."
https://www.imdb.com/name/nm0778734/