之前的碰撞箱问题部分得到了解决,我将角色的根节点设为characterbody2d,然后设置了一堆碰撞箱,这些碰撞箱的位移和旋转跟随骨骼的area2d子节点,就解决了之前的多碰撞箱问题。



但现在又有问题了,当我水平翻转我的角色(将characterbody2d的scale的x值设为-1)时,碰撞箱的显示与跟地板的接触是正常的,但实际碰撞有问题
而当我将characterbody2d子节点的碰撞箱的旋转值设为负数时,碰撞箱的显示与跟地板的接触有问题,实际碰撞没问题,这令我非常困惑/(ㄒoㄒ)/~~



这会不会是由spine和godot的坐标系统导致的问题(spine的y轴向上,godot的y轴向下)?

Related Discussions
...

在使用 spine-godot 运行时时,角色翻转可能会导致碰撞箱的问题,尤其是在水平翻转角色时(例如将 characterbody2dscale.x 设为 -1)。这可能是由于 Spine 和 Godot 的坐标系统差异引起的,Spine 的 Y 轴向上,而 Godot 的 Y 轴向下。

当你翻转角色时,确保所有相关的子节点(包括碰撞箱)也正确地翻转。你可以尝试在翻转角色时同步更新 SpineSpriteSpineBoneNode 的变换,以确保它们的世界变换与角色的翻转一致。此外,检查碰撞箱的旋转和缩放是否与角色的翻转保持一致,避免在翻转时出现不一致的变换。

如果问题仍然存在,可能需要在 Godot 中手动调整碰撞箱的变换,以确保它们在翻转时正确地与角色的视觉效果和物理效果保持一致。

    Spinebot 能否在新版本的运行时中对坐标系的差异进行兼容?真的,只要解决掉坐标系差异的bug,我的游戏就能正常运行了/(ㄒoㄒ)/~~

    The y coordinate difference between Spine and Godot shouldn't matter, as that's handled internally.

    I'm having trouble understanding the issue. Could you maybe create a minimal Godot project that reproduces the issue?

      Mario
      我该如何上传我的项目呢?最小项目打包成Zip大小是45.6Mb,系统总是提示文件太大了

      我发现,使用godotd默认物理引擎时不会有上述问题,但使用rapier2D时会有上述问题

      Mario 我也想用视频或给您发项目文件以重现问题,但这个网站总是提示文件过大/(ㄒoㄒ)/~~
      不过当我把Godot的引擎换成Godot内置的Godotphysics2D时上述翻转问题全部消失,游戏能正常运行了,在我发布这个问题的时候,我有的物理引擎是Rapier2D,看来是Rapier2D跟Spine的兼容性不太行

        Cyan_Bean Sorry for the confusion. Please send the project via email: contact@esotericsoftware.com
        Please include the URL of this forum thread in the email so we know the context. Then we can take a look at what's wrong.

          Misaki 你们这边有没有能保持60帧以上地运行100以上带有Spine骨骼角色的简易Godot项目供我参考学习?我这边似乎又遇到了性能问题,64个带有Spine动画的Characterbody(之前展示的角色)在同一屏幕上渲染时只有40帧,每个角色每0.2s同时发射10发子弹时,帧率下降至个位数

            Cyan_Bean Thank you for submitting your Godot project! I confirmed that when the scale is negative, the collision detection area shifts below the character. We will look into it and get back to you as soon as we find out something.

            Cyan_Bean FPS drops occur depending on the complexity of the skeleton, so there are no examples that can be used as a general reference. It is best to always check performance issues with the actual skeleton and target platform.

            To improve performance, first check the Metrics view in Spine. The Spine User Guide provides detailed explanations of which values to pay particular attention to in this view, so please refer to it to check if there are any elements causing the problem:
            https://esotericsoftware.com/spine-metrics

            @Cyan_Bean I've spent over a day debugging your repro project. I could not figure out what's wrong.

            Then this morning, I switched the Physics Engine to GodotPhysics2D. Result:

            It works as intended. This leads me to believe that Rapier2D has a bug. No other code was changed for this to work. Both physics engines get the exact same positions from the bones of the character. But Rapier2D seems to use those incorrectly.

            I suggest you submitt the repro to the Rapier2D developers, as I'm not informed about its code.