Robert Pattinson had to learn to drive for the part