• RuntimesUnity
  • Help with getting the position of a bone in a SkeletonGraphic (UI Canvas)

Hello,

I'm trying to move a SkeletonGraphic (UI) during runtime to the position of one of it's bones. The problem is that this SkeletonGraphic needs the property of LayoutScaleMode = Width Controls Height and as far as I know all the GetBonePosition type functions (also the bone.WorldX and bone.WorldY) are returning the position for the rect not scaled. So my position is off.

I've also tried using the BoneFollower and BoneFollowerGraphic but the same result happens, the bone follower goes to the unscaled position.

So my question is, how should I do this? How can I get the real position of a bone in a SkeletonGraphic (UI Canvas) that is scaled by the UI?


  • Misaki ответили на это сообщение.
    Related Discussions
    ...

    OriolEz Hi, our Unity Master, Harald, is on vacation until September 21st and will reply when he returns. Sorry for keeping you waiting, but please wait for his reply.

    @OriolEz Thanks for reporting and sorry for the troubles! BoneFollowerGraphic was indeed ignoring the layout-based scale, we will provide a bugfix for this issue shortly.

    If you need to access the combined scale of the parent canvas scale and layout scale, you can access it via
    SkeletonGraphic.MeshScale.

    @OriolEz The above issue regarding BoneFollowerGraphic and related components ignoring layout scale has just been fixed. Thanks for reporting!

    A new spine-unity 4.1 unitypackage is available for download:
    https://esotericsoftware.com/spine-unity-download

    Issue ticket URL for later reference:
    EsotericSoftware/spine-runtimes2378

    Thank you!