Then we tried to implement some avoidance and change of formation depending on the obstacle. We used Unity's raytracing method to check it there is obstacle's infront the group. It didn't work as we had imagined, and it somehow looks like it only works for the first raycast (leader's raycast). For improvement, we might try some colliders instead of raycasting.
The video above is a hard-coded version of the raytracing method.