— Hudson Yang, breakout star of the hit ABC comedy “Fresh Off the Boat,” was in a funk.

The third episode called for Yang, then 11, to grab the behind of a grown-up neighbor. Sensing his inexperienced star’s unease, executive producer Jake Kasdan called a timeout. For 20 minutes, he sprawled on a stuntman’s mat with the preteen and talked him through the uncomfortable premise.

The shoot went off without another hitch.

What might seem like harmless sitcom hanky-panky served as a reminder: Yang isn’t just any actor — he is a child still learning about the world and his place in it.

Hollywood is a tough place to grow up. In an industry where each minute represents thousands of dollars, catering to a kid’s needs can be inconvenient. And young performers often develop a sense of entitlement that may lead to body issues, misbehavior, chemical abuse or worse.

It also can keep them from enjoying the most cherished role of all: a normal childhood.

“Child actors may seem smart for their age, but they’re still kids,” said Robert Bailey Jr., who at age 3 posed for print ads in Minneapolis and at 26 now stars in “The Night Shift” for NBC. “You’ve got to look out for them just as you would any child in the real world.”

Bailey said he doesn’t regret his early start in the business. But he feels shorted on certain rites of passage.

“I had a brilliant experience, getting to travel all over the world, working with people I admire. I learned how to play the saxophone and how to lasso,” he said. “But there are certain things I missed out on, like school dances, sports teams, friends you don’t get to see every day.”

“Modern Family” star Sarah Hyland was already an 18-year-old high school graduate when she was cast as 15-year-old daughter Haley Dunphy.

“You can get your GED, get home-schooled and all that, but there’s nothing like high school, where your best friend fools around with your boyfriend,” Hyland said. “You’ll never get that anywhere else. You need that kind of stuff to grow as a person.”

Having a ball

Most families would be willing to make those sacrifices if their child turned out to be as successful and grounded as Yara Shahidi.

In addition to winning an NAACP Image Award for playing Zoey on ABC’s “Black-ish,” the 16-year-old Minneapolis-born actress has been heralded as a real-life role model. This summer, she spoke at a United Nations Summit for girls, part of a nine-day East Coast tour that included breakfast with cultural commentator Michael Eric Dyson and a tour of Georgetown University, where he teaches.

“We’re having a ball,” said her mother, Keri Shahidi, by phone from Washington, D.C., in July. “I tell my kids, ‘You don’t have a mortgage or expenses. Why not have some fun? And, oh, don’t forget to pick up your check.’ ”

But Hollywood actors have to worry about acting their age. Take Yang, a clear front-runner for the part of Eddie until an audition in front of executives. Producers had ordered in Chinese food and the young performer pigged out, inhaling 20 dumplings before the table read.

“He went into a food coma and was slumped down in his chair,” said Melvin Mar, Kasdan’s producing partner. “Every studio head afterwards said, ‘What are we going to do with this kid? You’ve got to replace him.’ ”

Mar and Kasdan were able to convince the brass — Yang, now 12, and “Boat” sail into their third season next month — but those in a hiring position tend to prefer young actors who come across as pocket-size adults.

Life in the fast lane

“The Detour,” a hit TBS sitcom that mines laughs from a family’s road trip to heck, has two cast members under age 13. They experience foul language, a trip to a strip joint and the spectacle of their loopy parents having sex while splashing around a hotel pool.

The show’s star and co-creator, Jason Jones, insists that the young actors are mature enough to handle these scenarios.

“These kids are like 17 inside,” he said. “At the same time, I’m a parent, and I would not make them do anything I wouldn’t make my own children do.”

Maybe, but confidence in one’s junior peers may lead them to believe they are wiser — and more important — than they really are.

In a 2007 visit to the set of “Hannah Montana,” I was impressed with then-14-year-old Miley Cyrus, who giddily offered a tour of her changing room, which she decorated to reflect her infatuation with disco.

Her co-star Mitchel Musso was another matter. Greeting a visitor to his dressing room, he climbed onto a stool atop his makeup table to ensure he would lord over his guest. While Cyrus has developed into a powerful and relatively stable force, Musso was pulled over for drunken driving five years ago and subsequently written out of his show, “Pair of Kings.”

“There’s this weird rule that when you’re an actress, nobody is allowed to say no to you,” said Eden Sher, who was 18 when she was cast as a dangerously optimistic daughter in “The Middle.”

“Thank goodness I experienced so much rejection early on. I got to live my life not growing up in a vacuum where you’re the center of attention and everyone is so interested in what you have to say. You can get validation from that, and that’s super harmful.”

Actors who grew up in the limelight often face far worse than a DWI, as anyone who has ever picked up a supermarket tabloid can tell you: Lindsay Lohan treating rehab centers like a revolving door; Drew Barrymore becoming a fixture at Studio 54 at age 9; Shia LaBeouf getting arrested for trespassing at an all-night drugstore; Britney Spears shaving her head in front of the paparazzi.

Some bounce back. Others do not.

American nightmares

Vanessa Lengies, who grew up on NBC’s “American Dreams,” never had any public brushes with the law, but the way she tells it, she simply didn’t get caught.

“My head got really light and big until I thought I could do whatever I wanted,” said Lengies, who followed that stint with several series, including “Glee.” “Nobody wants to tell you that anything you do is wrong or that your behavior needs to improve.”

It helps to have mindful parents, but the allure of stardom can blind families to such dangers as pedophilia. Preying on children in show business is more prevalent than outsiders realize, according to the 2014 documentary “An Open Secret.” Parents who come from outside the industry’s centers — Minnesota, for one — may relax their natural instinct to protect their children from strangers.

“Be on the lookout for casting calls in smaller towns,” said Anne Henry, who heads the BizParentz Foundation, a nonprofit that advocates for families engaged in the Hollywood industry. “They will tell kids that they are very special, but very often they are sorting out their prey.”

Then there are the parents who are even more eager for attention than their children. Charlotte Stewart, who played Miss Beadle on “Little House on the Prairie,” said the children on the iconic show weren’t executive producer Michael Landon’s biggest problem.

“The kids were never uppity, but some of the parents were,” she said. “They would say things like, ‘I need special treatment because my kid is blah, blah, blah.’ Nope, sorry. We don’t work that way.”

The best parents see the showbiz route as a unique learning experience that can teach everything from money management to how to deal with rejection. Getting a ticket to a Vanity Fair after party should be low on the priority list.

“If you’re a bad mom, you’re going to be that kind of mom regardless,” said Tracy Bobbitt, who edits the Hollywood Mom blog and has a teenager in the business. “Soccer moms are actually worse.”

Of course, it helps if folks have a compassionate captain on deck. Even better if the boss is a Hollywood child himself, like Kasdan, the son of Oscar-nominated writer/director Lawrence Kasdan.

Jodie Sweetin, who was 5 when she was cast as Stephanie Tanner in “Full House,” said she paid extra attention to the youngsters on set for Netflix’s recent reboot of the series.

“I hope I can share with these kids and their parents what it’s like to be suddenly famous, something a lot of people don’t understand,” said Sweetin, who chronicled her post-stardom drug use in a memoir called “UnSweetined.”

One lesson that never gets old: Have fun.

“I try to be a cheerleader,” said Fred Savage, who graduated from childhood stardom on “The Wonder Years” to direct numerous sitcoms, including “Hannah Montana” and “Modern Family.”

“The set should be a place where they can have fun and have success. That’s true whether they’re 8 or 80. Everyone still wants a sense of playfulness and safety.”

And an unlimited supply of dumplings.