lengthdir_x / lengthdir_y lands — click, drag, get GameMaker codelengthdir_x(len, dir) and lengthdir_y(len, dir) answer one question: "if I walk len pixels in direction dir, how far do I move on X and Y?"
Direction in GameMaker: 0° = right, 90° = up, 180° = left, 270° = down. It goes counter-clockwise (because screen Y points down).
Typical use: placing something offset from an object — a gun muzzle, a held item, a light source, an orbit point:
var _muzzle_x = x + lengthdir_x(48, image_angle);var _muzzle_y = y + lengthdir_y(48, image_angle);
Rotate with image_angle: if the offset should turn with your object (like a gun barrel), enable that option — it adds image_angle to the direction so the point follows your sprite's rotation.
Set a point's type to Line (in the active-point panel) and pick an Output of collision_line or collision_rectangle. Each line point becomes a segment from its base (origin or parent point) to its tip.
Why this is powerful: a rotating collision box (car doors, swinging hitboxes, turret arcs) normally forces you to hard-code a separate version for each angle. With image_angle added to the direction, one set of points works for every angle — no more if image_angle == 0 / 90 / 180 / 270 blocks.
Tip: make a Point for the hinge/anchor (offset from the object), then Shift+click to add a Line child — that child is the swinging segment. Use draw_line output first to see your boxes in-game, then switch to collision_line.