The 27-year-old actor was worried that he would turn out to be a mere face in the sleuth film and had to be convinced about the script by the film's co-producers Dia Mirza and Sahil Sangha.
"It took a lot of convincing from Dia and Sahil to get me on board for this film. I had my own questions regarding the film, my role and where I would fit in a movie which has a female protagonist," Ali told PTI.
"I am a little choosy about the films I do. So, I had to be exactly sure about my role in the film and had to be clear that I am more than just a face or a love interest and had something substantial to do in the movie," he said.
The film, which will hit theatres this Friday, centres around Vidya's character Bobby, who wants to become the best detective in Hyderabad. Ali says although the film's title suggests that it is a detective movie, the core story is about relationships and aspirations.
"There is a romantic story that runs parallel as the film is about relationships. It is about a girl who is trying to get out of the mundane, conservative life and this boy who is trying to move to a big city. My character brings out the coy side of Vidya's character, who is like a gundi," he said.
Ali says he had no apprehensions about romancing Vidya, who is older than him, and feels it was her tremendous acting that pushed him to perform better in the scenes he shared with the actress.
"While we were shooting I never felt like she is older to me. She is like a child, an energy ball in herself. She would just light up the scenes we did. She is a great actress and I think it is because of her that my performance was better," Ali said.
Ali rose to fame after playing an engineering student Three Idiots, which also starred Aamir Khan. He has since featured in films like Always Kabhi Kabhi produced by superstar Shah Rukh Khan and last year's surprise hit Fukrey.
"Fukrey was a major turning point of my career because it was post this film that I started getting lead roles in films like Bobby Jasoos. So, far it has been a great journey and I think the credit goes to Aamir (Khan) and SRK. They have been really great mentors to me. I treasure them a lot," said the actor, who has appeared in several TV commercials.
Ali is currently shooting for Mahesh Bhatt's Khamoshiyan, which has prevented him from touring cities for promotions of Bobby Jasoos. He will also star in Ramesh Sippy's film Sonali Cable opposite actress Rhea Chakraborty.