• RuntimesGodot
  • Godot and bounding box

Exactly right. The reason we don't expose the bounding box attachments in Godot is because they can be animated. Which means their polygonal region might change over the course of an animation. Sadly, Godot (and most physics engines) do not support changing a colliders shape every frame. It's thus better to setup collision shapes on a SpineSprite directly in Godot, as Ryusui said.

  • इस पर yinmo ने जवाब दिया।
    Related Discussions
    ...

    I suppose now that I've said this (and had it confirmed), I have a question of my own.

    I may be remembering incorrectly, but the official spine-godot module does not presently support Events (unlike rayxuln's), correct? If this is so, what would be the best way to enable/disable hitboxes during an animation, e.g. for an attack animation with a wind-up?

    Oh, excellent! I don't know why I thought otherwise. Maybe I read something in a different context and got confused? @_@;

    एक वर्ष बाद में
    Nate ने Godot टैग जोड़ा।

    Mario
    Hi, Mario, thanks for the runtime for Godot.
    However, I still hope for a bounding box solution, the morphing polygon part isn`t what I needed though. I just desire the features that Unity, which faces the same limitations, has. For example: rotation, following, turning on and off during a clip, etc. I know these can be worked around with bone followers and events already, but matching events to a large number of colliders is a tedious task.

    In addition, the RootMotion feature would also be very nice.

    Can you please at least consider adding them?
    Thanks in advance

    For example: rotation, following, turning on and off during a clip,

    You have to be more specific what you mean by that.

    I know these can be worked around with bone followers and events already

    Again, you have to be more specific. Please describe your exact use case. Otherwise we are discussing features in a vacuum which usually leads to bad design.

    What is not going to happen is that features we add to spine-godot will work exactly like in spine-unity from an API or "scene" point of view. Unity and Godot are not similar enough for this to be a good way to go about it.

    We'd prefer to add things in a way that's idiomatic to Godot.

    • इस पर yinmo ने जवाब दिया।

      Mario
      I mean during an attack animation, there might be three phases: Winding up, Active, and Recovering. Of these three, I only need the hitbox active in the Active phase. The red boxes in this link are good examples. Currently, I can only send an event signal when the box is active and another when it is deactivated, when there are large numbers of boxes, matching the event signal to a specific collision shape will be loads of work. What I want is to have a checkbox in SpineBoneNode or SpineSlotNode, when it is checked, a CollisionShape2d node corresponding to the bounding box will be generated as a child node and the show and hide of it during runtime will be synched to the animation clips. Considering that the positioning and scaling of these collider boxes can already be done with SpineBoneNode, and the show and hide of the bounding box are also implemented in the Debug section of SpineSprite, I think it is doable. And please note that I don`t need to reshape the polygons during runtime, most times, a rectangle is all I need.

      And RootMotion would be nice as well.

      Thanks

      You'd think this is "doable" but if we add something like this, we don't have to just make it work for your specific case, but for other use cases as well.

      Let's say we add boolean flag to SpineBoneNode that means "Create a collider if true", and another flag that means Collider active. What is the shape of the collider based on? The attachment in the setup pose? Well, that won't work if someone uses skins and set a skin at runtime. This would mean you see no collider, or a wrong collider in the Godot editor. Or the collider will retain the shape of the setup pose attachment, while at runtime a differently shaped attachment from a skin is active.

      What if the attachment is a mesh with a non-rectangular shape? You might be fine with just a rectangle, but others are most likely not and want proper mesh colliders. What if that mesh attachment has a deform animation on it? The collider would have to be recreated every frame.

      There's a lot more to this than just adding rectangles to a SpineBoneNode, as different users have different needs and use cases. We can't just add a hacked up thing for one user I'm afraid.

      What I want is to have a checkbox in SpineBoneNode or SpineSlotNode, when it is checked, a CollisionShape2d node corresponding to the bounding box will be generated as a child node and the show and hide of it during runtime will be synched to the animation clips.

      You mean the collision shape would be activated/deactivated depending on whether the corresponding slot in the skeleton has an active attachment or not?

      Currently, I can only send an event signal when the box is active and another when it is deactivated, when there are large numbers of boxes, matching the event signal to a specific collision shape will be loads of work.

      I'm afraid I still don't understand what you mean. Whatever we implement in the runtime, it would not be setting up any signals for you. Could you describe what you'd expect in that regard? You will have to differentiate between the collision shapes (fist, leg, whatever) somewhere in your code, i.e. if a fist hit deals less damage than a leg. I don't see how we could help with that.

      • इस पर yinmo ने जवाब दिया।

        Mario

        You mean the collision shape would be activated/deactivated depending on whether the corresponding slot in the skeleton has an active attachment or not?

        Yes, this is exactly what I meant and it is what I needed most.

        I'm afraid I still don't understand what you mean. Whatever we implement in the runtime, it would not be setting up any signals for you. Could you describe what you'd expect in that regard? You will have to differentiate between the collision shapes (fist, leg, whatever) somewhere in your code, i.e. if a fist hit deals less damage than a leg. I don't see how we could help with that.

        The latter part of my text is just my workaround for my need asserted previously. I would send events in Spine editor called activateCollider/deactivateCollider with the name of the collider as a string parameter or an int for an intex to CollisionShape map in Godot. As for how much damage each collider does in each clip I will set up my own code.

        I would send events in Spine editor called activateCollider/deactivateCollider with the name of the collider as a string parameter or an int for an intex to CollisionShape map in Godot.

        But you can do that already, setting up the events in the Spine Editor I mean. In the Godot editor you'd set up corresponding collision shapes via the SlotNode mechanism. At runtime and in your game code, you can then listen for these events, take the event string or int value, which could be the name or index of the collision shape, look it up in the scene graph, and activate/deactivate it.

        • इस पर yinmo ने जवाब दिया।

          Mario
          Yes, that's why I said it is my current workaround. I just hope it can be automated like the SlotNode can activate/deactivate itself based on whether its bounding box is on/off during the animation clip.