Spawn hit fx() (sample page)

With this function you can spawn a visual effect at any given point within the room. The visual effect is spawned as a new instance of the  object. This function returns the id of the new instance which can then be stored in a variable or used to access that instance.

Syntax
spawn_hit_fx(x, y, hit_fx_index);

Returns
real

Basic
// spawns a built-in visual effect (water large) on the 1st frame of the 4th window of AT_FSPECIAL: if (attack == AT_FSPECIAL && window == 4 && window_timer == 1) { spawn_hit_fx(x, y, 195); }

Advanced
// init.gml // creates a visual effect from sprite strip "custom_fx_sprite_strip#.png" and stores its index in a variable custom_hit_fx = hit_fx_create(sprite_get("custom_fx_sprite"), 20);

// attack_update.gml // spawns a visual effect and stores its instance ID in a local variable to move the hit_fx_obj to a depth in front of the player: if (attack == AT_FSPECIAL && window == 4 && window_timer == 1) { var temp_fx = spawn_hit_fx(x, y, custom_hit_fx); temp_fx.depth = depth - 1; }