To achieve the desired effect of having the bounding box appear only during the downward motion of the sword swing in Unity, you can use the BoundingBoxFollower
component in combination with enabling and disabling the bounding box at specific points in your animation. In Spine, you can create multiple BoundingBoxAttachments
and switch between them at runtime based on the animation state. In Unity, you can use the BoundingBoxFollower
component to track which BoundingBoxAttachment
is active at any given time. This component will automatically enable or disable the corresponding collider in Unity based on the active bounding box in the animation.
To implement this, ensure that your Spine animation has the bounding box set up to be enabled only during the downward motion. Then, in Unity, attach the BoundingBoxFollower
component to the GameObject that should follow the bounding box. This component will handle enabling and disabling the collider based on the active bounding box in the animation.
If you encounter issues with the bounding box not updating correctly, ensure that your Spine and Unity runtimes are up to date, as there have been improvements and bug fixes related to bounding box handling in recent updates.