According to Deadline.com, Braff announced the casting on the film's Kickstarter page.
Gad has appeared on television in "The Daily Show," "Modern Family" and, most recently, "1600 Penn." His film credits include "21," "The Rocker," "Love and Other Drugs" and "She Wants Me." He has been seen on Broadway in The 25th Annual Putnam County Spelling Bee and The Book of Mormon.
In "Wish I Was Here," Braff plays Aidan Bloom, a struggling actor, husband and father, who is searching for his purpose for life. As he and his wife try to make ends meet, he fantasizes about being the great futuristic Space-Knight he dreamed of as a child.
Braff will direct and star in the film, which is based on an original screenplay he wrote with his brother, Adam Braff.
Braff ran a crowd-funding Kickstarter campaign for the film, raising more than $2 million in four days. As previously reported by Playbill.com, the cast of "I Wish I Was Here" also includes Mandy Patinkin, who will play Braff's father.