Will Smith has opened up about “After Earth,” the 2013 sci-fi film in which his son Jaden Smith also starred, calling it the “most painful failure” of his career.

The comment, in an interview with Esquire, came after the reporter referenced a “Fresh Prince of Bel-Air” quote from Smith’s TV aunt, who advised his character on an episode, “Don’t let success go to your head and failure go to your heart.”

“That was a valuable lesson for me a few years ago with ‘After Earth,'” Smith said. “That was the most painful failure in my career.”

The Sony/Columbia pic, directed by M. Night Shyamalan, made $27 million on opening weekend and grossed a global $243 million on a reported production budget of $130 million. In comparison, in 2008, “Hancock,” the Smith-starring fantasy drama from Sony/Columbia, raked in $624 million globally and made $62 million on opening weekend. His rom-com “Hitch” made $368 globally and $43 million on opening weekend.

Smith said “Wild Wild West,” a pic that also opened with $27 million, was still a better experience.

“‘Wild Wild West’ was less painful than ‘After Earth’ because my son was involved in ‘After Earth,’ and I led him into it. That was excruciating,” the 46-year-old said. Then he contemplated the importance of having films that topped box office charts.

“I never would have looked at myself in that way. I was a guy who, when I was 15, my girlfriend cheated on me, and I decided that if I was number one, no woman would ever cheat on me. All I have to do is make sure that no one’s ever better than me, and I’ll have the love that my heart yearns for. And I never released that and moved into a mature way of looking at the world and my artistry and love until the failure of ‘After Earth,’ when I had to accept that it’s not a good source of creation.”

Smith said when he received box office numbers the following Monday, he was “devastated for about 24 minutes,” and shortly after, he received a call that his father had cancer. “That put it in perspective — viciously.”

After a 90-minute treadmill session immediately following the news, Smith had an epiphany.

“That Monday started the new phase of my life, a new concept: Only love is going to fill that hole,” Smith said. “You can’t win enough, you can’t have enough money, you can’t succeed enough. There is not enough. The only thing that will ever satiate that existential thirst is love. And I just remember that day I made the shift from wanting to be a winner to wanting to have the most powerful, deep and beautiful relationships I could possibly have.”