Problem statement

Describe: 1) If you use a scale on bones the actual position of the child bones in the Unity editor will differ from their expected position

Give step-by-step instructions so we can reproduce the problem, if possible.
Unity
Spine

Source file:

turttest.zip
3MB

Animation: glasses_loop

Runtime information

Spine 4.1.24 Professional
Unity 2022.3.11

But through Bone Follower, bone position tracking works correctly.

Related Discussions
...
  • Modificato

@paulp The problem is that the bone TurtleHead has Inherit Scale disabled, but the Unity Transform hierarchy, which mirrors your bone structure using SkeletonUtilityBone GameObjects, has no option to ignore parent scale.

The solution is to move the TurtleHead GameObejct from being a child of the Turtle4 GameObject (its parent bone) to being a child of the main SkeletonAnimation GameObject as shown below. Then remove the SkeletonUtilityBone component at the re-parented TurtleHead GameObject and instead add a BoneFollower component set to follow the TurtleHead bone.

Sorry that the setup procedure is a bit more complex here, unfortunately Spine's hierarchy system is more powerful than what game engines usually have to offer.

@paulp In general it is recommended to use BoneFollower components when you only need to follow a few bones and don't want to override bone locations. Having the whole hierarchy of SkeletonUtilityBone GameObjects comes with some overhead (having many GameObjects and SkeletonUtilityBone update cost). The only requirement is that a SkeletonUtilityBone with Mode Override needs the parent GameObject to be at the proper parent bone location. This can be achieved without the overhead of the whole hierarchy of parent bones by having just the parent bone of your Override SkeletonUtilityBone object as a BoneFollower GameObject.

So this hierarchy:

Bone1   [SkeletonUtilityBone - Follow]
  Bone2   [SkeletonUtilityBone - Follow]
    Bone3   [SkeletonUtilityBone - Follow]
      Bone4   [SkeletonUtilityBone - Follow]
        OverrideBone   [SkeletonUtilityBone - Override]

can be simplified to the following:

Bone4  [BoneFollower]
  OverrideBone   [SkeletonUtilityBone - Override]

Thanks!