Welcome to the very strange, and strangely moving, world of “Storks.”

Writer/director Nicholas Stoller, known for such adult comedies, such as “Forgetting Sarah Marshall” and “Neighbors,” delves into the family-friendly animated genre in a little movie about where babies come from. Or where they used to come from. In this world, the old wives’ tale of storks delivering bouncing bundles of joy is real history, although the birds have been relegated to delivering packages for cornerstore.com after one became too attached to a baby.

Stoller teams up with experienced animator Doug Sweetland for directing duties, and the story balances the fantasy world with more mundane realities. The film starts out as a workplace sitcom, as our protagonist, Junior the stork (Andy Samberg), is fired up for a promotion from boss Hunter (Kelsey Grammer). Unfortunately, accident-prone human orphan Tulip (Katie Crown) keeps getting in his way. She’s the baby at the center of the stork-attachment incident, and she’s been raised in the warehouse.

In the human world, Nate (Anton Starkman), an only child, wishes for a baby brother to play with while his parents (Ty Burrell and Jennifer Aniston) are preoccupied with their real estate business. He discovers an old pamphlet for stork baby delivery and sends off a letter. Through Tulip’s misguided helpfulness, the baby factory is fired up once more. The cornerstore.com motto says, “Always deliver!” So Tulip and Junior find themselves on an adventure to get the new baby to the family and be back in time for StorkCon and Junior’s promotion.

The story is fairly standard — a quarreling odd couple learn about themselves and each other through a perilous journey — but Stoller embellishes the tone with a sense of deep weirdness. There’s room for bizarre little gags and side tangents that are silly enough to delight kids and parents alike, as well as fast and furious joke delivery from the comedic voice talent. One of Junior’s undermining co-workers, Pigeon Toady (Stephen Kramer Glickman), sports a surfer drawl and a mop of Trumpian orange hair, and a wolf pack led by a pair voiced by Keegan-Michael Key and Jordan Peele have unique abilities to transform themselves into various land and water vehicles.

“Storks” is at times cacophonous and overly busy, and the animation tends toward the goofily humorous rather than the spectacular. However, Stoller manages to pull off a third act and emotional resolution that’s genuinely moving. There’s a metaphor going on about the futile regulation of a “baby factory” that can’t be controlled by larger profit-driven corporate forces, layered with deeper themes about couples who want babies and don’t have them yet.

The emotional core of the film, with Junior and Tulip bonding through their adventures and making friends along the way, is that family is what you make of it. Maybe a baby makes a family, but maybe friends are family; maybe family is bound by shared DNA, or maybe family is a wolf pack. What matters is what you do with your family, how you spend time with them, show them that you care and share a life together. That so resonant a message comes in such a wildly weird and funny package is just about as oddly pleasant as you can imagine.