Ah okay, sorry - sometimes the simplest solutions allude us so I wanted to make sure you weren't missing something obvious!
I'm guessing that the platform is made of tiles? If so, that makes it a little more complicated to calculate.
If it is a tile and you know it's draw depth you could use
tile_layer_find(depth, x, y);
.... Something along the lines of:
GML:
// Create
draw_line_to_tile = noone;
// Whatever event makes most sense
var depth = -1000;
for(var i = 0; i < SIZE_OF_TILE * 4; i++) { // * however many you want to check
var tile = tile_layer_find(depth, x, y + (SIZE_OF_TILE * i));
if(tile != -1) {
draw_line_to_tile = tile;
break;
}
}
// Draw
if(draw_line_to_tile != noone) {
draw_line(x, y, draw_line_to_tile.x, draw_line_to_tile.y);
}
I'm honestly not sure if this would work, or if it's an efficient way of doing so - but it's an idea! If anyone else could chime in, that would be great.
You might need to use
tile_get_x(index);
and
tile_get_y(index);
somewhere in here too, but I'm not sure. Worth testing out I suppose!
Of course the hacky way would be to just draw a line under the spider from its (x,y) to straight upwards and keep twiddling with the numbers until it works - but if you plan on having more than one spider, that would not be ideal.