Will Smith has revealed that his "Emancipation" co-star Ben Foster didn't speak with him for six months to stay in the character.

The 54-year-old actor opened up during the "Red Table Talk" show Wednesday about how he wanted to thank everyone on the set on the first day of production but said that Foster ignored him.

"In my mind, I was giving my best 'Will Smith' and Ben just walked past me and didn't say nothing," Smith recalled. "I was like, 'Oh, he must not have seen me.' Then for six months, he didn't speak to me."

The actor went on to reveal that Foster didn't even make eye contact with him nor say a single word. "He didn't acknowledge me for six months," Smith added.

The "Bad Boys" star explained the reason behind Foster's silence was to stay in character.

"But what he did that first day. I was like, 'Yup. Got it. We're not playing. This is real; this is serious. We're not fooling around with these ideas,'" Smith said. "I really credit Ben for clicking me into the next gear of depth and focus."

Smith further shared that it was the last day when Foster finally spoke with him.

"Emancipation" is helmed by director Antoine Fuqua. It revolves around a true story of a slave named Peter who runs away from a Louisiana plantation after being tortured by the owners. The movie was released in theatres on Dec. 2 and started streaming on Apple TV+ on Dec. 9.

In the same episode, Smith also mentioned an unplanned scene where one of his co-stars spat on his face.

"One of the first days on set, there is a scene with one of the actors and he leans down in my face and says, 'You a cold one, ain't you?' and then he ad-libbed..." he said, imitating how his co-star spat on him. "I was like, 'Makeup!' No, but it was like ... I was like, Whoa, every actor on this set was taking it really, really seriously."

Smith will be next seen in the movie, "The Council," as Nicky Barnes. He will also appear in the movie, titled "Fast and Loose," as John Riley. The actor will also reprise Mike Lowrey's character for the fourth installment of "Bad Boys."

Will Smith
BEVERLY HILLS, CALIFORNIA - MARCH 27: Will Smith attends the 2022 Vanity Fair Oscar Party hosted by Radhika Jones at Wallis Annenberg Center for the Performing Arts on March 27, 2022 in Beverly Hills, California. Lionel Hahn/Getty Images