Primary cilia are compartmentalised from the rest of the cell by a ciliary gate comprising transition fibres and a transition zone. The ciliary gate allows the selective import and export of molecules such as transmembrane receptors and transport proteins. These are required for the assembly of the cilium, its function as a sensory and signalling centre and to maintain its distinctive composition. Certain motile cilia can also form within the cytosol as exemplified by human and Drosophila sperm. The role of transition fibre proteins has not been well described in the cytoplasmic cilia. Drosophila have both compartmentalised primary cilia, in sensory neurons, and sperm flagella that form within the cytosol. Here, we describe phenotypes for twitchy the Drosophila orthologue of a transition fibre protein, mammalian FBF1/C. elegans dyf-19. Loss-of-function mutants in twitchy are adult lethal and display a severely uncoordinated phenotype. Twitchy flies are too uncoordinated to mate but RNAi-mediated loss of twitchy specifically within the male germline results in coordinated but infertile adults. Examination of sperm from twitchy RNAi-knockdown flies shows that the flagellar axoneme forms, elongates and is post-translationally modified by polyglycylation but the production of motile sperm is impaired. These results indicate that twitchy is required for the function of both sensory cilia that are compartmentalised from the rest of the cell and sperm flagella that are formed within the cytosol of the cell. Twitchy is therefore likely to function as part of a molecular gate in sensory neurons but may have a distinct function in sperm cells.