Know it's an old thread, but I ran into this exact same problem with GameMaker and was unable to find solutions posted anywhere, nor any tutorials that included functional code. I'm posting here in the event someone else finds it and is in need of a solution.
I tried to build a script based on the runtimes to convert coordinates as suggested above, but that made the problem even worse. Ultimately went to just solving it myself with what made logical sense to my brain. Surprisingly, it worked! 😉
This code assumes that the "aim_target" bone is parented directly to the root. No idea what would happen if your skeleton is set up otherwise. I placed this code in the Animation Update event of the object drawing the Spine animation. It tracks the mouse, and continues to track the mouse if the spine animation is rotated.
var root_map, aim_map, relative_mouse_x, relative_mouse_y, relative_mouse_angle, relative_mouse_distance, aim_target_x, aim_target_y;
root_map = ds_map_create();
skeleton_bone_state_get("root", root_map);
aim_map = ds_map_create();
skeleton_bone_state_get("aim_target", aim_map);
relative_mouse_x = mouse_x - ds_map_find_value(root_map, "worldX");
relative_mouse_y = mouse_y - ds_map_find_value(root_map, "worldY");
relative_mouse_angle = point_direction(ds_map_find_value(root_map, "worldX"), ds_map_find_value(root_map, "worldY"), mouse_x, mouse_y);
relative_mouse_distance = point_distance( ds_map_find_value(root_map, "x"), ds_map_find_value(root_map, "y"), relative_mouse_x, relative_mouse_y )
aim_target_x = (ds_map_find_value(root_map, "x") + lengthdir_x(relative_mouse_distance, relative_mouse_angle - ds_map_find_value(root_map, "angle"))) / image_xscale;
aim_target_y = (ds_map_find_value(root_map, "y") + lengthdir_y(relative_mouse_distance, relative_mouse_angle - ds_map_find_value(root_map, "angle"))) / image_yscale * -1;
ds_map_replace(aim_map, "x", aim_target_x);
ds_map_replace(aim_map, "y", aim_target_y);
skeleton_bone_state_set("aim_target", aim_map);
/* Use This To Display Bone Data for either "root_map" or "aim_map". Swap the names accordingly. Thanks Community!
var _next = ds_map_find_first( root_map );
var _count = 0;
while ( !is_undefined( _next ) ) {
var _string = string( _next ) + " " + string( root_map[? _next ] );
show_debug_message("root_map: " + string( _string ));
_next = ds_map_find_next( root_map, _next );
_count++;
} */
ds_map_destroy(root_map);
ds_map_destroy(aim_map);
Edit: Changed + ds_map_find_value(root_map, "angle") to - ds_map_find_value(root_map, "angle") after the update to the GameMaker runtimes to 4.0. \o/