Zoe Kravitz's latest role hit a little too close to home when she was filming. The actress, whose parents are Cosby Show alum Lisa Bonet and rocker Lenny Kravitz, stars in the upcoming The Road Within as a woman struggling with anorexia — something Kravitz herself has battled in the past.

Chosen as one of five cover girls for Marie Claire's Fresh Faces 2015 issue — along with Iggy Azalea, Hailee Steinfeld, Felicity Jones, and Kate Upton — the gorgeous 26-year-old opened up to the mag about losing weight to play the part and confronting some of her former demons.

"I went through eating disorders in high school, so it triggered some old stuff," the After Earth actress admitted of dieting down to 90 pounds for the movie. "I was so thin that I wasn't getting my period."

That wasn't even the worst part, though. "Part of me didn't want to gain the weight back, which was really scary," she told the mag. "People were like, 'You look so good!' I was like, 'Oh my God, that is disturbing.'"

Kravitz has been increasingly candid in recent months, telling both Complex and Nylon about her past struggles with body image and food. "I don't think it was about the fame, but I think it was definitely about being around that world, seeing that world. I felt pressured," she told Complex in its April/May 2015 issue.

"My mother's a…beautiful woman, and I think, in some way, I felt intimidated by that sometimes," elaborated Kravitz, who is arguably a doppelganger for 47-year-old Bonet. "[And] my dad dated a lot of supermodels."

Having battled anorexia and bulimia before, Kravitz related to the character of Marie in The Road Within. Their shared history is what drew her to the role — but it's also what scared her about taking it on.

"It was f–ked up, man. You could see my ribcage. I was just trying to lose more weight for the film, but I couldn't see: 'You're there. Stop.' It was scary," she told Complex. "It made me not only confront my demons but also realize and accept an insecurity that's still there, and [that it's] easy to fall back into that pattern."

Kravitz said she lost the weight by "drinking pureed vegetables and tea, and running every day" for exercise. "I tried to do it in a healthy way, but it's not a healthy thing to do — I would never tell anyone to lose that amount of weight and especially not that quickly," she told Nylon.