This is an investigation of collective motion of fish swimming in the presence of obstacles. The authors analyzed trajectories of zebrafish swimming in a tank with varying densities of pillars. As the density of pillars increased, the experiments exhibited a transition from mostly aligned fish, to fish oriented along the axes of the pillar lattice. The authors considered the relative orientations of two fish and developed a stochastic model, which qualitatively reproduced the experimental data.