Get hitbox angle

This function returns the knockback angle of the specified  instance. This takes into account the hitbox's angle flipper. The coordinates and  of the calling instance are used in the calculations for the angle flipper.

Syntax
get_hitbox_angle( hitbox_id );

Returns
real (knockback angle)

Advanced
// article1_init.gml // sets up some variables for an article that can be hit only once can_be_hit = true; simulated_damage = 25; simulated_kb_adj = 0.9;

// article1_update.gml // performs very simple hit detection and applies knockback to the article if ( can_be_hit ) { var final_hbox = noone; with pHitBox { if ( hit_priority > 0 && place_meeting( x, y, other ) ) { if final_hbox == noone { final_hbox = id; }           else if hit_priority > final_hbox.hit_priority { final_hbox = id; }       }    }    if instance_exists( final_hbox ) { var hit_angle = get_hitbox_angle( final_hbox ); var hit_kb = final_hbox.kb_value + simulated_damage * 0.12 * simulated_kb_adj; hsp = lengthdir_x(hit_kb, hit_angle); vsp = lengthdir_y(hit_kb, hit_angle);

can_be_hit = false; } }