"I was still breastfeeding, so he had to be close to me at all times," the actress said of nursing her newborn while shooting Dora and the Lost City of Gold

Being a mom in real life certainly helped Eva Longoria tap into her newest role as an onscreen mother — but the star didn’t realize how much becoming a mom impacted her ability to portraying a mother on screen.

In an interview with Extra over the weekend, the 44-year-old actress opened up about how having her own child (13-month-old son Santiago Enrique) made her a little bit more protective of young actress and movie daughter, Isabela Moner, who plays Dora the Exporter in the upcoming new film, Dora and the Lost City of Gold.

“It changed all my instincts,” she said of having son Santi, who was with the star on set as Longoria played Moner’s mom — her first role as a mother since becoming one in real life. “My moral compass was totally bonkers.”

“I just had new eyes on the world,” Longoria explained. “There was a scene where Michael [Peña, who plays Dora’s dad] and I were standing there and Dora runs back into the crumbling temple, and Michael and I were like, ‘No, no, no! We would never let our child run into the crumbling temple — that’s dangerous!’ ”

Want all the latest pregnancy and birth announcements, plus celebrity mom blogs? Click here to get those and more in the PEOPLE Parents newsletter.

June birthdays
Credit: Eva Longoria/Instagram
From L to R: Eva Longoria, Isabela Moner and Michael Peña in Dora and the Lost City of Gold
| Credit: Paramount Players

“It was against every instinct in my body to not keep my child safe and let her run around the jungle, but it’s Dora,” she told Extra.

Speaking of her first child with husband José “Pepe” Bastón, baby Santi was by Longoria’s side as she filmed in Australia last year, hanging out in his mom’s trailer between feedings.

“I was still breastfeeding, so he had to be close to me at all times,” the actress shared. “When I am directing and producing, he is always with me on set.”

Eva Longoria
Eva Longoria
| Credit: Alexander Tamargo/Getty

RELATED VIDEO: Roselyn Sanchez Remembers Eva Longoria Directing Grand Hotel While Breastfeeding: “It’s Inspirational”

Since welcoming Santi last June, Longoria has learned there’s not one secret to balancing work and motherhood. As she told Parents magazine in a cover interview for their August issue, “You just do it and get it done.”

But despite “not sleeping” and scheduling conflicts concerning feeding and pumping, the former Desperate Housewives actress admitted her baby boy makes parenting “easy” for her and husband — primarily thanks to little Santi’s sunny disposition and easygoing nature.

“He’s healthy, he’s funny, he’s sweet, he sleeps, he eats,” Longoria told Parents.

Dora and the Lost City of Gold opens nationwide on Aug. 9.