Several insects require both olfactory and visual cues during odoursource localisation to successfully locate an odour source. In the male silkmoth, Bombyx mori, detection of the female sex pheromone triggers a programmed walking pattern, starting from a surge (straight-line walking) followed by zigzag walking. Although pheromone-triggered behaviour in silkmoths is well understood, the role of visual cues remains obscure. To address this question, we performed behavioural experiments on tethered-walking moths by recording their locomotion during stimulation with a pheromone and a visual motion pattern (optic flow). The experiments were conducted under open-and closed-loop visual stimuli. We found that the use of optic flow input was determined by the behavioural state of surge and zigzagging. Silkmoths exhibited an optomotor response, which is a behavioural visual response, by turning towards the same direction as optic flow stimuli only during surge, but not during zigzagging. In addition, modulation of the zigzag walking pattern was observed when the moths were presented with biased closed-loop visual stimuli (visual feedback with biased constant optic flow); however, the directional preference mechanism was different from that of the optomotor response. Based on these findings, we suggest that the optomotor response is utilised for course control during straight-line walking, whereas the absence of optomotor response during zigzagging is used to effectively perform the programmed walking pattern. Considering the neural basis of programmed behaviour, we speculate that at least two visual pathways are involved in the statedependent use of optic flow during odour tracking behaviour in silkmoths.