Involved in spermatogenesis, specifically in the morphogenesis of fibrous body-membranous organelles (FB-MO), which are Golgi-derived organelles used for transporting sperm-specific components, in spermatocytes and in their localization into budding spermatids (PubMed:16143610, PubMed:2744235). Required for the proper formation of spermatids and spermatozoa (PubMed:2744235). hexadecanoyl-CoA + L-cysteinyl-[protein] = CoA + S-hexadecanoyl-L-cysteinyl-[protein] Mainly found in fibrous body-membranous organelles. Expressed during spermatogenesis in budding and budded spermatids. Only expressed during spermatogenesis in adult males and in hermaphrodites in the larval stage 4. The DHHC domain is required for palmitoyltransferase activity. Self-sterile phenotype which is slightly temperature sensitive (PubMed:16143610). In hermaphrodites the temperature sensitivity is restricted to the larval stage 4 when spermatogenesis takes place (PubMed:16143610). Premature disassembly of FB-MO before or while spermatids are budding from spermatocytes (PubMed:2744235). FB remain in spermatocytes whereas MO localize to spermatids but often fail to fuse with plasma membrane (PubMed:2744235). Resulting spermatids are usually smaller than normal and contain several or mislocalized nuclei (PubMed:16143610, PubMed:2744235). Fewer spermatozoa are generated and those that are have abnormally short pseudopods and are immotile (PubMed:2744235). The size of spermatocytes is unaffected (PubMed:2744235). Increased life span and resistance to UV and heat but not to oxidative stress induced by paraquat (PubMed:10638523). Normal production of fertile oocytes (PubMed:10638523). Belongs to the DHHC palmitoyltransferase family.