• RuntimesUnity
  • Problem with "Update when Invisible"

Hi there!
How are you all doing? I hope well.

I have a new problem related to optimizing my project. I've been changing all spine objets to modify the "update when invisible" to "only events" from "full update" as pointed by my programmer.

However, after doing this, some animations (not all of them) keep static even when visible. Why could this be?

If more information is needed don't hesitate to ask for it.

Thank you!!

  • Harald đã trả lời bài viết này.
    Related Discussions
    ...

    Yimec However, after doing this, some animations (not all of them) keep static even when visible. Why could this be?

    I assume that by "keep static" you mean that they don't change back to Update Mode FullUpdate and no longer resume playing the animation? If so, could you please send us a minimal Unity project which still shows this issue? You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.

    @Yimec Which exact version of the spine-unity runtime are you using?

    • Yimec đã trả lời bài viết này.

      Harald 4.1.(7? I guess so)

      I will try to deliver you this project so you can see what is happening.

      Thank you!

      • Harald đã trả lời bài viết này.

        Yimec Harald 4.1.(7? I guess so)

        You can find the exact version either as the name of the unitypackage or in Assets/Spine/version.txt, or alternatively in the Unity Package Manager, if it has been installed this way. If you're really seeing version 4.1.7 in the Unity Package Manager, please have a try updating the package as 4.1.7 is very old, the latest 4.1 spine-unity runtime version is 4.1.41.

        I followed your indications and found this:

        Also, checked the problem and why it was happening only to a few objects and found out the issue appears with separator enabled objects. Does this mean something to you?

        @Yimec Thanks for the update, IIRC version 2023-08-14 is recent enough so you're not missing any bugfixes regarding this topic.

        Also, checked the problem and why it was happening only to a few objects and found out the issue appears with separator enabled objects. Does this mean something to you?

        This sounds interesting, it might likely be that the SkeletonRenderer no longer receives OnBecameVisible events since the MeshRenderer at the same GameObject is then disabled. Still it would be much appreciated if you could send us a minimal Unity project, as it might be depending on the order and timing of activating the SkeletonRenderSeparator and similar events.

        Just sent the email, @Harald !

        Let me know if you need anything else.

        Thank you!

        @Yimec Thanks for sending the reproduction package.

        In general please send the Unity projects as zip packages as requested (without unnecessary dirs like e.g. the library dir) and not as unitypackage, since this involves more steps for us to have a clean separate reproduction project.

        We'll get back to you here on the forum once we've figured out what's going wrong.

        • Yimec đã trả lời bài viết này.

          Harald Oh sorry, first time sharing a scene like this.
          I'll stay tuned, thank you!

          @Yimec No worries, just mentioning for the future so it saves us some time. I'll write here on the forum once we have a bugfix ready.

          @Yimec We have just pushed a safe bugfix on both the 4.1 and 4.2 branches. Now whenever a SkeletonRenderSeparator is active, the SkeletonRenderer counts as visible and no longer disables the updates upon seemingly becoming invisible. This should fix your issue, however no longer provides the benefits of disabling updates when truly invisible and off-screen.

          We are working on an improved bugfix as well which tracks visibility of each SkeletonPartsRenderer. This fix however will be released on the 4.2 branch only due to the necessary changes.

          New 4.1 and 4.2 spine-unity unitypackages are available for download here as usual:
          https://esotericsoftware.com/spine-unity-download
          Please let us know whether this fixes the issues on your end as well. Thanks again for reporting!

          Issue ticket for later reference:
          EsotericSoftware/spine-runtimes2519

          • Đã chỉnh sửa

          @Yimec We have now also pushed an improved bugfix to the 4.2 branch via this commit. This should now provide proper handling of disabling updates when all SkeletonPartsRenderers are invisible and re-enable updates when at least one SkeletonPartsRenderer is visible.

          If you want to use this commit in your 4.1 project, you would need to manually integrate the commit's changes.

          • Yimec đã trả lời bài viết này.

            Oh @Harald thank you very much for your support and help, I will try to integrate the commit into the 4.1 as changing the whole project to 4.2 is not an option now.

            I'm glad I helped you all to find a bug and you were able to fix it so fast!

            • Misaki đã thích điều này.

            Harald I've updated my 4.1 installation with the latest version and now it works, however, trying to update this version with the 4.2 changes manually integrating the commit's changes you reference I found out that commit is already applyed in the 4.1 version, so, could it be another commit what I have to integrate?

            At the moment, the spine objects are still animating out of frame when labeled as "Only Events" update (at least they do animate when vinsible), but the performance improvement is what we need to achieve.

            Thank you very much for everything!

            @Yimec Oops, sorry, I linked the wrong of the two commits. The correct 4.2-only commit to integrate in 4.1 would be this one:
            EsotericSoftware/spine-runtimes77e859c
            I will fix the links above.

            Now that makes sense. I updated the runtime editor with the commit but I had no time to check if everything is working fine, when I'm available to test everything I'll let you know.

            So far, thank you very much for everything, I have no words to explain how grateful I am with you all, as you always have time to help me.

            No hurry regarding the testing.

            Thanks very much for your kind words, much appreciated! 🙂