© 2020, Springer Nature Switzerland AG.Animals can carry their environmental sensing abilities beyond their own limits by using the advantage of being in a group. Some animal groups use this collective ability to migrate or to react to an environmental cue. The environmental cue sometimes consists of a gradient in space, for example represented by food concentration or predators’ odors. In this study, we propose a method for collective gradient perception in a swarm of flocking agents where single individuals are not capable of perceiving the gradient but only sample information locally. The proposed method is tested with multi-agent simulations and compared to standard collective motion methods. It is also evaluated using realistic dynamical models of autonomous aerial robots within the Gazebo simulator. The results suggest that the swarm can move collectively towards specific regions of the environment by following a gradient while solitary agents are incapable of doing it.