Thanks for the extremely quick response!
I'm exporting using Spine version 4.0 and using the latest Gamemaker 2 version.
I'm going to try to ask a better question:
From my understanding, in Spine, there are three kinds of bones.
The IK bone that looks like this:
The normal bone that looks like this (above the IK bone):
And then the bones that are affected by IK:
I have a block of code that works when I reference the "Up L arm" bone, but doesn't work for either of the other two bones.
In spine, when I play the animation it looks fine.
In Gamemaker I tried two different methods.
Method One: referencing the IK bone without a parent.
Method Two: referencing a parent bone of the IK bone.
Both give the "DoSub :1: undefined value" error.
When I first purchased Spine Pro, I think I remember getting this error when I referenced images from Spine, but then I didn't get the error when I started referencing bones. - just putting this here for more info.
But now I'm referencing those IK bones.
I make no changes to my code other than changing the referenced name of the bone.
For example:
skeleton_bone_state_get("Up L arm ", map); //WORKS
skeleton_bone_state_get("Front Arm IK Bone", map); //DOES NOT WORK
skeleton_bone_state_get("Front Arm IK", map); //ALSO DOES NOT WORK
Just in case it helps, here is the code I'm using:
In Gamemaker, I'm using an object's "Animation Update" event with the following code:
//CODE START
GML:
targetx = mouse_x
targety = mouse_y
var map = ds_map_create();
skeleton_bone_state_get("Front Arm IK Bone", map);
var xx = ds_map_find_value(map, "worldX");
var yy = ds_map_find_value(map, "worldY");
var deltax = targetx - (xx);
var deltay = targety - (yy);
if sign(image_xscale) = 1{ // facing right
var angle = (-radtodeg(arctan2(deltay, deltax)))-90;
}
if sign(image_xscale) = -1{ // facing left
var angle = (radtodeg(arctan2(deltay, deltax)))+90;
}
ds_map_replace(map, "angle", angle);
skeleton_bone_state_set("Front Arm IK Bone", map);
ds_map_destroy(map);
//CODE END