“Avengers: Infinity War” ends with plenty of death, but the secrecy of the Marvel Studios’ movie means that those deaths were kept under wraps for as long as possible. At least one actor didn’t find out they’d be dying until the day of filming.

[Spoiler Alert: The ending of “Avengers: Infinity War” is spoiled below.]

At the end of the movie, Bucky Barnes/Winter Soldier (Sebastian Stan) is the first character to disintegrate after Thanos (Josh Brolin) disappears with all the Infinity Stones. Half the universe disintegrates shortly after, but it seems Marvel never sat Stan down and told him that he’d be dying at the end of this movie.

At Wizard World Philadelphia this weekend, Stan revealed that he learned Bucky would disappear in the Snap from his stunt double. “I remember actually the day on set, and James Young, who is one of my talented, glorious stuntmen on this film, came up to me and actually told me what was happening.”

Sebastian Stan Avengers
Sebastian Stan is pictured at an “Avengers: Infinity War” event on April 8, 2018 in London. Tim P. Whitby/Getty Images

Young explained that Stan would fall onto a mat for the scene. “When you walk out, you’re gonna fall on it because you disappear,” Young told Stan.

“I was like ‘Wait, what?’” Stan recalled. Young told him that “Avengers: Infinity War” directors Joe and Anthony Russo would explain it.

Stan went to Anthony for answers about his character’s apparent death. “I was like, ‘Maybe this is it.’ And I remember Anthony Russo was talking to everybody, and I was like, ‘Anthony, the — O.K., I'll wait. Do you — am I — is this it?’”

The director, who didn’t let most cast members see the full script, was not forthcoming about what appeared to be Bucky’s death. “And he was like ‘No, well, you know, maybe. But not really. Well, I don’t know.’ And I was like ‘O.K.’ So, that’s the way that day went,” Stan said.

Avengers Infinity War deaths
There were many deaths in “Avengers: Infinity War.” Marvel Studios

The “I, Tonya” star also asked if the same thing happened to his good friend Anthony Mackie’s character, Sam Wilson/Falcon. He was thrilled to hear that Sam was also caught in the Snap.

Many fans expect several characters to return from the dead, but the directors have emphasized that the Avengers won’t walk away unscathed in “Avengers 4.”

“I think one thing we’ve illustrated since we got involved with the Marvel Universe, that I think a direction we’ve been pushing it in, is that there are real costs. There are real costs involved and those costs always balance out in some way,” Joe warned on the Happy Sad Confused podcast earlier this month.

“Avengers 4” hits theaters May 3, 2019.