Actress Zoe Kravitz attends the "The Divergent Series: Insurgent" premiere at the Ziegfeld Theater, March 16, 2015, in New York.
camera (Tyler Boye/Getty Images) Actress Zoe Kravitz attends the "The Divergent Series: Insurgent" premiere at the Ziegfeld Theater, March 16, 2015, in New York.

Zoe Kravitz did not have to search far to get into character for her role as an anorexic woman in the upcoming film "The Road Within."

"That was pretty easy for me," Kravitz told Nylon magazine. "I struggled with an eating disorder in high school and into my early 20s.

“That’s part of what actually attracted me to the role; I think it’s really important to talk about body image and the struggles a lot of women have with food, especially in the entertainment industry. I related to her in a lot of ways."

Kravitz, 26, went into more detail about her struggle with Complex magazine.

"I had a really hard time when I was 16, 17, 18... Just a [hard time] loving myself," she told Complex. "I think it was part of being a woman, and being surrounded by [fame]. 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."

Part of that pressure came from her being the only child of her attractive famous parents, Lisa Bonet and Lenny Kravitz.

"My mother's a beautiful woman, and I think, in some way, I felt intimidated by that sometimes," Kravitz told Complex.

Understanding her character's eating disorder did not make preparing for the role of Marie any easier, however. Kravitz dropped 20 pounds off her already tiny frame.

"Losing all the weight -- I’ve never done anything like that before," she told Nylon. "I put my body through so much and at first it was really hard to even have a conversation because I was so lightheaded all the time. On top of just being tired, I had to try and perform, so it was very unique experience. I lost like 20 pounds, so I was 90 pounds while we filmed."

Though she tried to shed the pounds in what she called "a healthy way" -- "I basically did a cleanse and was drinking pureed vegetables and tea, and running every day" -- the experience took a toll on her.

"My parents got really scared for me to go back down that road," she told Complex. "You could see my rib cage. I was just trying to lose more weight for the film but I couldn't see: You're there. Stop. It was scary."

Kravitz became ill after filming ended. She told Complex her immune system shut down and her thyroid was thrown off.

Now back to a healthy weight, she is grateful for the experience, which she said helped exorcise some demons.

"I feel like something has left my body, like some part of me is gone now, something that was making me so insecure," she told Complex. "And it feels amazing."