Rami Malekwill always remember a humbling, live-in-the-moment lesson he unexpectedly learned fromRobin Williamswhile filming what would become the late actor’s final live-action movie before his death.
“We’re shooting at the British Museum at night and we have the place all to ourselves,” beganThe Little Thingsstar, 39. “And Robin — you could tell something was happening with him. He would go on these riffs every once in a whileand light up the world and you’d be like, ‘Oh my God. Who are you?’ And then dip back down into this other place.”
According to Malek, Williams would “see us all on our phones and devices and he’d be like, ‘What happened to [face-to-face communication]?’ "
“And so I see him veer off and he walks off alone, and he’s just kind of staring atthis massive rock in the British Museum. And I’m like, ‘Oh, man. What’s going on with him? Is he all right?’ " the Oscar winner continued.
Never miss a story — sign up forPEOPLE’s free daily newsletterto stay up-to-date on the best of what PEOPLE has to offer, from juicy celebrity news to compelling human interest stories.
Patrick Gallagher, Robin Williams, Ben Stiller and Rami Malek inNight at the Museum: Secret of the Tomb.Kerry Brown/20th Century Fox/Kobal/Shutterstock

Rami Malek (L); Robin Williams.Frazer Harrison/Getty Images; Jason LaVeris/FilmMagic

He soon realized Williams was reflecting on how far communication has come, and taking advantage of an opportunity to be in the presence of one of the most important relics in human history to appreciate the moment.
“I walk up to kind of say, ‘Is everything okay?’ And he looks at me, just kind of slightly over the shoulder, and he goes, ‘How often do you get to be alonewith the Rosetta Stone?’ " Malek explained.
“That’s the best story I’ve ever heard in my life,” hostJimmy Fallontold him, joking in addition, “And you were like, ‘Apparently not enough because I just interrupted you.’ "
Robin Williams in 2013.Robin Marchant/Getty Images

Want to get the biggest stories from PEOPLE every weekday?Subscribe to our new podcast,PEOPLE Every Day, to get the essential celebrity, entertainment and human interest news stories Monday through Friday. Get a taste of the podcast below.
RELATED VIDEO:JumanjiChild Star Bradley Pierce Recalls How Robin Williams Stood Up to Producers for Him
InRobin’s Wish, a recent documentary focused on the final months of Williams' life,Secret of the Tombdirector Shawn Levy saysWilliams was having a hard time on set. The actor had been struggling with diffuse Lewy body dementia (LBD) for months, which causes fluctuations in mental status, hallucinations and impairment of motor function.
“When Robin would call me at 10 at night, at two in the morning, at four in the morning, saying, ‘Is it usable? Is any of this usable? Do I suck? What’s going on?,’ I would reassure him. I said, ‘Youare still you. I know it. The world knows it.You just need to remember that,’ " the director added.
“My faith in him never left, but I saw his morale crumbling,” Levy said. “I saw a guy who wasn’t himself and that was unforgivable.”
source: people.com