• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

GML How i can create a pointer for a gun?

if i use a draw_rectangle(x,y,mouse_x,mouse_y,20);

it creates me a rectangle but not do a good pointer

so if i want to create a laser pointer and can collide with every object that is visible how i can do it?


Forum Staff
For drawing, you have draw_line_width.
For collision, you could use multiple collision_lines in a loop, one for each pixel, or use a rectangular, rotated, precise collision mask scaled to or created at the desired length and width. There may be other methods.