Pixar/Disney is known for wringing tears from every gorgeous frame and Onward, its new big-budget offering, tells the story of two teenage elves: Ian (Tom Holland) and his older brother Barley Lightfoot (Chris Pratt), whose late father left a gift for them to open on Ian’s 16th birthday. It is a spell, which offers them an unimaginable opportunity: to spend one more day with him.

Then the spell goes wrong, or rather, only half-right. The brothers are granted only Dad’s purple-socked, chino-clad, dancing legs – and a quest is required to bring all of him back. What follows is hilarious and heartbreaking, both for people who have never experienced such grief, and those who have. When Ian briefly meets an old schoolfriend of his father’s, who provides new, precious details of his life, the moment resonates powerfully, as does Ian playing a cassette of his father’s voice, with which he holds a conversation.

Onward is based on the director and co-writer Dan Scanlon’s personal story. As we meet in a plush Soho hotel, he is shy but warm, mentioning the piece I recently wrote for the Guardian about my own childhood bereavement. His father died in a car accident when he was one and his older brother aged three. Scanlon was not going to answer questions about the nature of his dad’s death until very recently, as he did not want to upset his mother. “But I double-checked with her and she said: ‘Yeah, it’s fine.’ She’s really great – like the mom in the movie.” The part is voiced by Julia-Louis Dreyfus.

When he was 16, an aunt and uncle gave Scanlon a cassette featuring his father’s voice. He only says two words on it: “Hi!” and “Goodbye”. “In a weird way,” he says, “I felt: ‘Oh, I can tell he’s shy and nervous when he over-says the hi. Then I can tell he’s a little awkward when he says goodbye. Oh, he’s my brother and I!’” The need to know a parent, he says, is often to get a road-map for yourself, to know who you could be, or can be.

After storyboarding Pixar’s smash-hit Cars and directing 2013’s Monsters University, Scanlon was encouraged to develop personal stories. Friends and colleagues reminded him about the tape; it took six years for Onward to be developed and made. Scanlon did not talk to his brother at all about the film, though. “I wanted to keep him in the dark. Because these movies take so long to make, you kind of want to make them for someone.”

I want the takeaway to be: talk to that person who went above and beyond for you. Say it now while you can Dan Scanlon

The fraternal relationship in Onward gets the most laughs. The younger Ian is basically Scanlon: “Super-awkward and shy, he’s also terrified to drive, which I never did.” Barley is a wild, Dungeons and Dragons-loving nerd who drives a beaten-up van called Guinevere (Scanlon’s own brother is a “quiet computer programmer”). Taking their father’s legs on their quest also gives the film a welcome lightness. “Suddenly seeing those legs falling down the stairs or dance like a goofball, to kind of embarrass the boys or be an indignity – that was important. That’s what family members do.”

The Lightfoots also live in a fantastical recreation of the suburbs. Here, magic has been overtaken by modernity’s easy gleam. Haunted taverns have become theme restaurants. Unicorns snaffle rubbish out of bins. The Michigan-born Scanlon and his brother “also had this mythical person in our suburbs, in our lore, so the setting made sense”.

Other great characters include a gutsy female manticore (Octavia Spencer) and a gay female police officer (Lena Waithe), who marks the arrival of Disney’s first LGBT character. “We want the world to feel real, so we wanted to represent the diversity that’s in the real world. These worlds that you create live and die by how they touch reality.”

And Onward really does. The film’s ending manages to be deeply affecting without being excessively sentimental or unrealistic. Its title also subtly suggests the need to keep going. Scanlon felt this intensely after showing the film to his family. His mother was at the premiere: “She was very proud and moved. She kept grabbing my hand.” Scanlon’s brother saw it at the wrap party only a few weeks ago. “He gave me the longest hug he’s ever given me.”

The director knows what he would like the film to do long-term: “I want the takeaway to be: talk to that person who went above and beyond for you. Say it now while you can.”

Onward is out on 29 February for just one day, then on general release from 6 March