• RuntimesUnity
  • SkeletonGraphic with separatorParts not scaling correctly

Hi, I have a character using SkeletonGraphic with the Separator setup as below.

Everything works fine other than the separatorParts not getting scaled together the gameObject where the SkeletonGraphic is.

I was wondering if you could add a line like separatorParts[p].localScale = this.transform.localScale; to this:

    Related Discussions
    ...

    sandolkakos Sorry to hear you're having troubles. Unfortuantely we could not reproduce the issue you are having. How are you scaling the SkeletonGraphic GameObject? Could you show what result you expect to get, and what you see instead?

    Also, which version of the spine-unity runtime (name of the unitypackage, also listed in Assets/Spine/version.txt) are you using?

      Harald , thanks for replying.

      My character is a SkeletonGraphic, meaning it is rendered in the Canvas. It is separated into 2 parts, where Part[0] should be shown behind the Book and [Part1] in front of the Book as in the image below:

      The Part[1] scales correctly because it is a child of the SkeletonGraphic (character), but because the Part[0] is not a child, it does not scale automatically. Btw, its position and rotation always follow the SkeletonGraphic (character).

      Currently, as a temporary solution, I've created a script to make the Part[0] follow a target scale and pointed it to follow the SkeletonGraphic (character). But it would be nice to have the option to make that happen natively as the position and rotation do. 🙂

      Regarding the version, I add Spine to my project via UPM:

          "com.esotericsoftware.spine.spine-csharp": "https://github.com/EsotericSoftware/spine-runtimes.git?path=spine-csharp/src#4.1",
          "com.esotericsoftware.spine.spine-unity": "https://github.com/EsotericSoftware/spine-runtimes.git?path=spine-unity/Assets/Spine#4.1",
          "com.esotericsoftware.spine.timeline": "https://github.com/EsotericSoftware/spine-runtimes.git?path=spine-unity/Modules/com.esotericsoftware.spine.timeline#4.1",

        sandolkakos Thanks for the clarification, I was missing the typical scenario of different parents per part renderer.

        We have just added a updateSeparatorPartScale property to SkeletonGraphic, new commit has been pushed to the 4.1 and 4.2-beta branches.

        From the Changelog:

        "Added updateSeparatorPartScale property to SkeletonGraphic to let render separator parts follow the scale (lossy scale) of the SkeletonGraphic GameObject. Defaults to false to maintain existing behaviour."

        New 4.1 and 4.2-beta spine-unity unitypackages are available for download:
        https://esotericsoftware.com/spine-unity-download

        Regarding the version, I add Spine to my project via UPM:

        Now we don't need the version any more, but if we should ask about that again, please let us know the UPM package version or the last update date. 🙂 UPM packages also don't update themselves 😉

          Harald I can confirm it works perfectly. Thanks for the quick feature addition! 🎉

            sandolkakos Thanks for the quick feedback, glad it helped 🙂. And thanks for reporting!

            2 mois plus tard

            Hi @Harald , after using the new Spine version in our App, our QA team is getting random exceptions that I guess are coming from the changes realized on commit:

            it could be that some of our SkeletonGraphic characters have no separated parts and we are still enabling the Update Part Location and Update Part Scale options. But I'm not totally sure. Just pinging you here cause it can be an issue happening to more people.

            Stack trace of the exception:

            ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
            Parameter name: index
            System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <00000000000000000000000000000000>:0)
            Spine.Unity.SkeletonGraphic.PrepareRendererGameObjects (Spine.Unity.SkeletonRendererInstruction currentInstructions, System.Boolean isInRebuild) (at <00000000000000000000000000000000>:0)
            Spine.Unity.SkeletonGraphic.PrepareInstructionsAndRenderers (System.Boolean isInRebuild) (at <00000000000000000000000000000000>:0)
            Spine.Unity.SkeletonGraphic.LateUpdate () (at <00000000000000000000000000000000>:0)
            Spine.Unity.Playables.SpineAnimationStateMixerBehaviour.ProcessFrame (UnityEngine.Playables.Playable playable, UnityEngine.Playables.FrameData info, System.Object playerData) (at <00000000000000000000000000000000>:0)

              @sandolkakos Terribly sorry to hear that you're facing troubles! We have just pushed a commit which might resolve your issue. A new spine-unity 4.1 unitypackage is available for download here as usual:
              https://esotericsoftware.com/spine-unity-download
              Please let us know if the issue persists after this package update.

              This issue is tracked under this ticket URL:
              EsotericSoftware/spine-runtimes2346

              sandolkakos after using the new Spine version in our App, our QA team is getting random exceptions that I guess are coming from the changes realized on commit:
              EsotericSoftware/spine-runtimes@ad614dc

              it could be that some of our SkeletonGraphic characters have no separated parts and we are still enabling the Update Part Location and Update Part Scale options.

              May I ask from which previous spine-unity package version you have updated? If you're using the downloadable .unitypackage file for installation, you can find the version string which includes the date in Assets/Spine/version.txt, or simply as name of the unitypackage file.

              I assume you've updated to the latest spine-unity 4.1 runtime package around the time of posting this, is this correct? Could you please still let us know the exact spine-unity package version you're using currently?

              Thanks for digging into this. Unfortunately I doubt that it has been the mentioned commit which introduced your problems, since the commit added behaviour logic which is inactive by default (a new bool parameter updateSeparatorPartScale must be enabled explicitly), and even if it were activated, the same problem should have occurred in the old existing code (section updateSeparatorPartLocation) a few lines above, since the behaviour is almost identical in terms of List-access.

                25 jours plus tard

                Harald Sorry for taking so long to reply, my last weeks were super rushed.
                We use spine via UPM with the following URLs:

                "com.esotericsoftware.spine.spine-csharp": "https://github.com/EsotericSoftware/spine-runtimes.git?path=spine-csharp/src#4.1",
                "com.esotericsoftware.spine.spine-unity": "https://github.com/EsotericSoftware/spine-runtimes.git?path=spine-unity/Assets/Spine#4.1",
                "com.esotericsoftware.spine.timeline": "https://github.com/EsotericSoftware/spine-runtimes.git?path=spine-unity/Modules/com.esotericsoftware.spine.timeline#4.1",

                I was checking which specific version we were using when the ArgumentOutOfRangeException happened and that is it:

                "displayName": "spine-unity Runtime",
                "version": "4.1.16",

                At the moment we are using the older version below and no issue was detected anymore:

                "displayName": "spine-unity Runtime",
                "version": "4.1.0",

                We are gonna keep using this version since I've created a script to make the different parts to follow the original part scale. When things get more calm, I will update it to see if everything is fine.

                Thanks for always replying and giving us useful information and fixes.