Next week, Sam Raimi will be making his long-awaited return to the superhero genre with the Marvel blockbuster “Doctor Strange in the Multiverse of Madness.” The film represents his first time back in the director’s chair after a nine-year hiatus following “Oz the Great and the Powerful” in 2013, as well as his first superhero movie since the end of his beloved “Spider-Man” trilogy in 2007.

In a wide-ranging interview with Rolling Stone, Raimi discussed stepping back into superhero films, and his memories of the original “Spider-Man” trilogy, which are widely regarded today as a turning point for superhero films. The series, however, ended on a less triumphant note with “Spider-Man 3,” which received mixed reviews. Although a fourth film was planned, it ultimately was cancelled in favor of a series reboot.

During the interview, Raimi revealed “Spider-Man 4” was aborted due to issues with the script, which wasn’t up to the standard he had for the film.

“It was a very painful experience for me,” Raimi told Rolling Stone writer Brian Hiatt. “I wanted to make a Spider-Man movie to redeem myself for that. [The aborted] ‘Spider-Man 4’ — that was really what that was about. I wanted to go out on a high note. I didn’t want to just make another one that pretty much worked. I had a really high standard in my mind. And I didn’t think I could get that script to the level that I was hoping for by that start date.”

During the interview, Raimi discussed ideas he had for his fourth “Spider-Man” film, including the possibility of “Evil Dead” star Bruce Campbell playing Mysterio, and the inclusion of Kraven the Hunter — soon to be played by Aaron Taylor-Johnson in a standalone spin-off — as the main villain.

Raimi also talked about the possibility of reuniting with his “Spider-Man” star, Tobey Maguire, for a belated trilogy sequel. Maguire recently reprised his role in the smash-hit “Spider-Man” crossover film “No Way Home.” Raimi said there would be many challenges associated with getting the movie made, but didn’t rule out the possibility of it happening.

“My love for the characters hasn’t diminished one iota,” Raimi told Rolling Stone. “It would be the same things that would stop me now that stopped me then: ‘Does Tobey want to do it? Is there an emotional arc for him? Is there a great conflict for this character? And is there a worthy villain that fits into the theme of the piece?’ There’s a lot of questions that would have to be answered. If those could be answered, then I’d love to.”

Elsewhere in the interview, Raimi shared many tidbits from his long career, including his attempt to make a Thor film in the early ’90s with Stan Lee and his friendship with Joel and Ethan Coen. Raimi also discussed some of the challenges and complications of making a film with Marvel Studios. Although he said that he had “complete creative freedom” while making the second “Doctor Strange,” he also touched on how the existence of other MCU projects that involved his characters affected the writing process for the “Multiverse of Madness” script.

“I’m not really sure what the ‘WandaVision’ schedule was or how it changed,” Raimi said about the show, which was initially meant to come out after his film. “I just know that halfway, or maybe three-quarters of the way into our writing process, I’d first heard of this show they were doing and that we would have to follow it. Therefore, we had to really study what ‘WandaVision’ was doing, so we could have a proper through line and character-growth dynamic. I never even saw all of ‘WandaVision;’ I’ve just seen key moments of some episodes that I was told directly impact our storyline.”

Read the full interview with Raimi here.