• Editor
  • How to get bone trajectory

  • Змінено
Related Discussions
...

I want to binding a sprite to skeleton's bone such as spineboy hand bone by runtimes, when spineboys hand move, the sprite move too.
I use findBone to find a left hand bone, I found that the local position is relative to the parent bone. I need to get a local position is relative to the root bone. run times are support that?
Anyone have a good idea, have any example.

5 днів пізніше

If the root bone is animated. You'd need to use the bone's worldX and worldY and subtract from it the root bone's worldX and worldY.

If you didn't animate the root bone, worldX and worldY will suffice. No additional calculation is necessary. This also applies if you animated the root bone but you really only needed the position of your bone relative to the skeleton's origin (which isn't necessarily the root bone).