Plays a role in cytotoxic granule exocytosis in lymphocytes. Required for both granule maturation and granule docking and priming at the immunologic synapse. Regulates assembly of recycling and late endosomal structures, leading to the formation of an endosomal exocytic compartment that fuses with perforin-containing granules at the immunologic synapse and licences them for exocytosis (By similarity). Regulates Ca(2+)-dependent secretory lysosome exocytosis in mast cells. Interacts with RAB27A and DOC2A. Both RAB27A and DOC2A can simultaneously bind UNC13D. Colocalizes with cytotoxic granules at the plasma membrane. Localizes to endosomal exocytic vesicles. Mast cells. The MHD1 and MHD2 domains mediate localization on recycling endosomes and lysosome. A truncating mutation is the cause of the jinxed phenotype (jinx), a chemically-induced mutation that make mice susceptible to murine cytomegalovirus (MCMV). It is a mouse model of human type 3 familial hemophagocytic lymphohistiocytosis. Affected mice produce a truncated protein that lack the second of the C2 domains and part of the second MHD domain. In jinx homozygotes, activated NK cells and cytotoxic T-lymphocytes (CTLs) fail to degranulate, although they retain the ability to produce cytokines. Mice do not spontaneously develop clinical features of hemophagocytic lymphohistiocytosis (HLH), but do so when infected with lymphocytic choriomeningitis virus (LCMV), exhibiting hyperactivation of CTLs and antigen-presenting cells, and inadequate restriction of viral proliferation. In contrast, neither Listeria monocytogenes nor MCMV induce the syndrome. Belongs to the unc-13 family.