The Riddler was not considered until Joel Schumacher and writers Lee and Janet Scott Batchler took over. When Joel Schumacher was brought on board as the new director, he threw out Tim Burton's plans for a Hallowe'en Batman movie with Brad Dourif as the Scarecrow.
It was Joel Schumacher who wanted Robin Williams to play the Riddler, and Lee and Janet Scott Batchler wrote the role with Robin Williams in mind. Robin Williams confirmed in November 19, 1993, that he had been talking to director Joel Schumacher about the project scheduled to film in September 1994, and he said that he thought playing the Riddler would be "nifty," but the script wasn't finished yet. Joel Schumacher was expecting the script to be in his hands on January 1, 1994.
After reading the script Robin Williams turned down the role. He believed the character was too intellectual and not as comedic as the Riddler played by Frank Gorshin on the TV series. Robin Williams was reportedly also concerned that his Riddler would be overshadowed by the film's other foe, Harvey Two-Face. So Joel Schumacher cast Jim Carrey instead. It took just 30 minutes of negotiation to cast Jim Carrey.