ChenTotal

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.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
ChenTotal
  • Beiträge: 9

Harald

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?
Benutzeravatar
Harald

Harri
  • Beiträge: 1096

ChenTotal

Unity:2018.4.1f1
Spine:3_7-2019-06-19

---

I added my spine file to my original post.
ChenTotal
  • Beiträge: 9

Harald

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?
Benutzeravatar
Harald

Harri
  • Beiträge: 1096

ChenTotal

That's correct.
It's just for test, so I didn't set keyframe and move anything.
ChenTotal
  • Beiträge: 9

Harald

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)
Benutzeravatar
Harald

Harri
  • Beiträge: 1096

ChenTotal

Did you use SkeletonGraphic in UI??
If I use SkeletonAnimation I can get different positions, but not with SkeletonGraphic in UI
ChenTotal
  • Beiträge: 9

Harald

Yes, I used SkeletonGraphic as child of a Canvas GameObject.
Benutzeravatar
Harald

Harri
  • Beiträge: 1096


Zurück zu Bugs