One of Chris Pratt’s recent pranks almost went horribly wrong.

The actor told host Jimmy Kimmel on his show Wednesday about a prank he tried to pull on the “Terminal List” team while shooting a difficult scene for the series.

Admitting the whole thing was “not smart,” Pratt explained how he’d been filming a scene where his character James Reece gets caught in a mudslide.

Pratt told Kimmel, “The last thing we did was me essentially getting buried alive. So I’m lying on about a 45-degree angle, buried up to my head in dirt and what they’re going to do is cover me with dirt.

“I’m breathing through a straw and they use an excavator to dump another big bucket full of dirt on top of me in the shot and I’m supposed to crawl my way out.”

READ MORE: Chris Pratt Shares Family Photos To Celebrate Third Wedding Anniversary With Katherine Schwarzenegger

The star then thought it would be hilarious to not move for about 30 seconds and then burst out from under the dirt.

“What I failed to realize after 30 seconds of not moving thinking it would be funny is that I actually couldn’t move,” Pratt recalled. “I could only move my right hand. Took a minute and a half and I finally get out and I cough up dirt.”

He laughed, “People come up to me, and go, ‘Dude, that was some of the best acting that I’ve ever seen you do.’ And I was like, ‘Yeah, I s**t my pants. That’s how committed I was.’”

Elsewhere in the interview, Pratt joked about finally learning how to spell his wife Katherine Schwarzenegger‘s last name.

“I’ve learned now,” Pratt admitted. “It’s a long name.”

READ MORE: Chris Pratt And Katherine Schwarzenegger Welcome Baby Girl

Pratt, who shares daughters Lyla, 1, and Eloise, who was born on May 21, with Schwarzenegger, told Kimmel: “There are a lot of letters in these children’s names.

“Schwarzenegger is the second middle name. We didn’t hyphenate the names. It’s a middle name.”

Kimmel then questioned whether Pratt’s father-in-law Arnold Schwarzenegger insisted on passing down the family name to the kids.

“That was Katherine,” Pratt, who also shares 9-year-old son Jack with ex-wife Anna Faris, said. “She’s got his strength. What Mama says, goes.”