Warning: This article contains spoilers for Spider-Man: Into the Spider-Verse, in theaters now.

In addition to receiving widespread critical acclaim in short order, Spider-Man: Into the Spider-Verse is also a fairly significant film in Marvel's cinematic history, since it's the first to feature a cameo from Stan Lee following the legendary comic book creator's passing earlier this year.

In the film, Lee's character passes the proverbial torch to Miles Morales by selling him his very first Spider-Man suit. However, as revealed by Into the Spider-Verse co-director Rodney Rothman, Lee's cameo was originally slightly different, with the final version ultimately being the result of a snap decision.

RELATED: Spider-Man: Into the Spider-Verse Almost Featured Another Marvel Hero

"The thing that was interesting for us is that it evolved," Rothman told IndieWire. "We recorded it a year ago and it was not that long after his wife [Joan B. Lee] had passed away. We had revisions that tried a little harder to be funnier and tried a little harder to be harder. What ended up in the movie were the lines that had the most meaning to him."

In the original script for Into the Spider-Verse, Lee's pivotal line involved him telling Miles that the (Spider-Man) costume "never fits." However, in an impromptu follow-up take, the line was changed to, "It always fits... eventually."

Rothman added, "In the moment, he has to deliver just enough to get that kid to put the suit on."

As it turns out, similar struggles and alterations were seen when it came to putting together the rest of the movie as well. However, if the response from fans and critics alike is anything to go on, the crew not only persevered, but did so in a major way.

"The movie was not very forgiving. When it wasn't working, you could feel it and it was painful," Rothman admitted. "About a year ago, we had a bunch of emotional tent poles that were fundamentally working. But then there were a bunch of scenes where it felt like there was only one way to make it and we had to find that way."

RELATED: Into the Spider-Verse Pays Fitting Tribute to Stan Lee & Steve Ditko

Luckily, the crew reached a breakthrough when they realized the importance of the other Spider-people in Miles' journey.

"This was all about being selfless because we're all heroes, but also the one guy who wouldn't die as a result of staying behind [Miles] can't do the job," said co-director Bob Persichetti. "And it was great because now we were in a really cool predicament. And we could push forward."

Directed by Bob Persichetti, Peter Ramsey and Rodney Rothman, Spider-Man: Into the Spider-Verse stars Shameik Moore, Brian Tyree Henry, Jake Johnson, Mahershala Ali, Hailee Steinfeld, Liev Schreiber, Luna Lauren Velez, Lily Tomlin, Nicolas Cage, John Mulaney and Kimiko Glenn. The film is in theaters now.