Rebel Wilson experienced a special connection between life and art while working on her new film.
The actress, who plays a woman trying to help her husband recover from a traumatic brain injury in IFC Films' upcoming movie The Almond and the Seahorse, recently shared the backstory with PEOPLE about returning to more dramatic roles.
While explaining her character Sarah's motivations, Wilson, 42, says Sarah "really wants a baby and struggles with the decision to stay with her husband" because her "desire to become a mother is so strong," a theme which deeply resonated with the actress, who was in the middle of her own fertility journey while making the film.
Wilson, who just revealed how she welcomed her first baby via surrogate, daughter Royce Lillian, recalls the difficulties it took to become a mom and how she received "terrible news" while filming The Almond and the Seahorse.
"During the filming I received some terrible news that all my harvested eggs up until that point had not survived being thawed," the actress shares.
Never miss a story — sign up for PEOPLE's free daily newsletter to stay up-to-date on the best of what PEOPLE has to offer, from juicy celebrity news to compelling human interest stories.
Courtesy of IFC Films
"So I'd lost a huge amount of weight and been through 3 surgeries at that point and no viable embryos," she explains. "It was devastating."
Yet, she says, "I knew that my desire to become a mother was so strong, that I needed to keep trying."
"It was feelings of loss, feelings of hope — and it all played into my performance," says Wilson. "It was a very emotional time."
While revealing her joyful baby news in an Instagram post on Monday, Wilson took time to thank her surrogate for helping make her long-held dreams of having a family come true.
Noting that she is "forever grateful to everyone who has been involved," Wilson said the process "has been years in the making."
"Particularly wanted to thank my gorgeous surrogate who carried her and birthed her with such grace and care," the new mom wrote. "Thank you for helping me start my own family, it's an amazing gift. The BEST gift!!"
The Almond and the Seahorse will be available in select theaters and to stream on Apple TV and on Prime Video Dec. 16.