In one of my animations the x coordinate of the bone in the editor is -157px, while after finishing the animation in the runtime I get -114px (while in the editor it is still -157px - the element shouldn't move) - what might be causing that change? The animation displays properly - only my bone reports such position when I use getX() on that bon...
Bone position
- Modifié
getX is the local position. Do you have the "Local" button pressed in the editor?
I had global turned on. With local pressed the value changes, how to get global position of a bone in runtime?
PS. Also why parent coordinates of a bone are different than local/global coordinates of it's parent (in editor)?
World position is the same as "global" in the editor (Bone#getWorldX, etc).
Children are positioned in their parent's coordinate system. Add all the positions to the root if you want the global/world position.
Thanks. It works now - I wasn't taking into account scale, so the coordinate was wrong when the scale was different than 1.