world position of bone

How do I get a bone’s world position?

I am trying to make a characters eyes look at the touch point. Using a simple test case, I can make a display object point at the touch point, so I know that my concept works and I have the math worked out.

when I try to apply the rotation values to the bone, it doesn’t work. I think that it is because I need to get the bones world x and y position.

I created a variable to store the bone like this:

eyeL = skeleton:findBone(“eyeL”)

How do I get the world position of the bone? Because I can only seem to get the local position of the bone, or the x,y values from the bone’s setup in spine.

thanks,

Dale

Hi,

I haven’t tried it myself, but a bone contains a worldX and worldY field. eyeL.worldX should give you the x position of the eye. I am not sure if this position is in relation to the skeleton.group though. Note that these fields are read only. Hope that helps a little :slight_smile:

Hi,

I haven’t tried it myself, but a bone contains a worldX and worldY field. eyeL.worldX should give you the x position of the eye. I am not sure if this position is in relation to the skeleton.group though. Note that these fields are read only. Hope that helps a little :slight_smile: