If you do a flybye with a human airunit on the Colossus and come within 60m the guns turn away and fire in the air. The same goes for the Defiler.
When a unit passes within the 30m mark on the Scorpion, Behemoth and Goliath. The gun then targets and fire straight up in the air for a brief time. And when you are within the 30m the guns target the unit again.