To achieve interactive elements in Unity using Spine, you can use Unity's raycasting capabilities to detect mouse interactions with your Spine character. For example, you can use Physics2D.Raycast
to detect clicks on specific parts of your character, such as the arm or cloth. Once you detect a click, you can use the BoneFollower
component to make the bone follow the mouse position. This involves setting up a BoneFollower
on the GameObject that represents the part of the character you want to interact with, and then updating the bone's position based on the mouse position during the drag operation.
For more detailed implementation, you can refer to the BoneFollower
component documentation: BoneFollower.