You obviously are counting the number of gears already. Make a behavior that kills the barrier actor when gears = required amount.