Hit particles appear whenever you land a hit on someone. Though they’re purely decorative, they can help sell what the attack hit them with; Base game characters use this for elemental-focused attacks.
Custom characters have 6 slots for custom hit particles. By default, these slots are automatically filled out with the files hit_particle1 – hit_particle6 in the sprites folder. (If those sprites don’t exist, an empty sprite is used instead.) You can change which sprite a particle uses by calling set_hit_particle_sprite( num:real, sprite_index:real ) in init.gml. For example:
set_hit_particle_sprite( 1, sprite_get( "custom_sprite" ) );
For more information on how sprites are loaded and animated in general, check the Sprites page.
The particles a hitbox spawns depends on the property HG_HIT_PARTICLE_NUM. By default this property is set to 0, which will use the regular “bullet”-shaped particles. Setting it to 1 – 6 will use the hit particles from that slot, and anything above that will behave the same as 0.
Hit particle sprites are stored and drawn slightly differently to normal sprites, and have a few important differences to keep in mind.
Due to the way hit particles are stored, they cannot be updated after init.gml runs, and will not update to match palette changes mid-match.
Transparency is handled differently; the color in the bottom left pixel of each frame is counted as transparency, and every other color will be completely opaque.