Using simulations, robots, and live fish, scientists at EPFL and Duke University have replicated the neural circuitry that allows zebrafish to react to visual stimuli and maintain their position in flowing water. They provide a complete picture of how brain circuits, body mechanics, and the environment work together to control behavior.