- Đã chỉnh sửa
SkeletonGraphic bones get the same world position
- Đã chỉnh sửa
I use SkeletonGraphic in my UI, and I try to get a bone's world position.
Spine.Bone bone = _testSpine.Skeleton.FindBone("bone");
Vector3 pos = bone.GetWorldPosition(_testSpine.transform);
Debug.LogError(pos);
bone = _testSpine.Skeleton.FindBone("bone2");
pos = bone.GetWorldPosition(_testSpine.transform);
Debug.LogError(pos);
No matter which bone I get, it always return the same world position as root's world position.
I think this is a bug.
We cannot reproduce your problem, we are getting proper locations at two separate bones.
Which version of Spine and the Spine-Unity runtime are you using?
Unity:2018.4.1f1
Spine:3_7-2019-06-19
I added my spine file to my original post.
Thank you for attaching the project.
When playing the single animation contained in the above file, I see not a single keyframe at any bone, and consequently nothing moving in the Spine project at all. Do you see different behaviour?
That's correct.
It's just for test, so I didn't set keyframe and move anything.
Anyway, after having exported your skeleton, I still cannot reproduce the problem you are describing, I get different positions printed:
(4.8, 6.6, 0.0)
(3.8, 4.6, 0.0)
Did you use SkeletonGraphic in UI??
If I use SkeletonAnimation I can get different positions, but not with SkeletonGraphic in UI
Yes, I used SkeletonGraphic as child of a Canvas GameObject.