Although not credited on the finished film, co-writer/producer Will Smith was responsible for much of the movie's direction. M. Night Shyamalan was primarily in charge of the blocking (composition of shots, placement of the camera) and the visual aspects of the film (color and design), and had actually suggested Smith for the supporting role as the father, but it was Smith who dictated the development of the story (which he originally conceived) and the on-screen action, and personally coached his own son Jaden Smith in his performance. Although both the story and acting were heavily criticized and Shyamalan decided to take the blame, Smith later shared his deep regret for involving his son in the movie: the press had released a vicious barrage of negative commentary aimed at Jayden, which hit the boy hard since he had only followed his father's instructions. Will added that Jayden understandably felt betrayed and misled for a while, and once even requested to be emancipated from his parents at age 15. He eventually decided against it.
The original idea for the film was a father and son on a camping trip. After the car they are traveling in careens off the road, the son makes his way through the forest to find help for the father. Realizing that the idea had greater potential, producer Will Smith and screenwriter Gary Whitta decided to adapt the basic survival concept into a much larger science-fiction project.
The original cut was 130 minutes long, and included more backstory on the decline of Earth and the formation of Nova Prime. However, the film was vastly re-edited after performing poorly at test screenings, and any actors playing Nova Primates were either reduced to extras or cut out entirely. The deleted footage will likely never be seen, as M. Night Shyamalan stated to be satisfied with the theatrical cut, although he would later disown the movie.
Will Smith, who had wanted to work with M. Night Shyamalan for several years but was unable to find a suitable project, personally contacted the director on his birthday to congratulate him. During the call, he pitched a 45-second story that intrigued Shyamalan, because it was about a son saving his father during an emergency rather than vice versa. Smith only ever intended the project for his son Jaden Smith, but to his surprise, Shyamalan immediately committed as director, and suggested that Will himself play the father in the film, to which he agreed. This became the first time in twenty years that Shyamalan accepted a project based on someone else's screenplay, and the first film in Shyamalan's career where he does not appear on screen.
When Kristofer Hivju showed up on set, he got into a discussion with the make-up department, who wanted to cut his characteristic long hair and beard. Hivju was against it, and was even supported by Jaden Smith, but eventually lost out. To make matters worse, most of his role was eventually deleted from the final cut.