Good evening guys, I'm new to spine, I'm trying to make my character's hand follow the mouse, i used solutions from this thread http://ru.esotericsoftware.com/forum/Spine-Unity-Making-the-arm-follow-the-mouse-7856 but they don't work , also i looked at your example "4 Object Oriented Sample" from the package, hand rotates but not correctly, this example uses Ik Spine Pro, but i am using ESS, how to make it work in ESS, I will be grateful.
public class boneController : MonoBehaviour {
public SkeletonAnimation skeletonAnimation;
[SpineBone(dataField: "skeletonAnimation")]
public string boneName;
public Camera cam;
Bone bone;
void OnValidate () {
if (skeletonAnimation == null) skeletonAnimation = GetComponent<SkeletonAnimation>();
}
void Start () {
bone = skeletonAnimation.Skeleton.FindBone(boneName);
}
void Update () {
var mousePosition = Input.mousePosition;
var worldMousePosition = cam.ScreenToWorldPoint(mousePosition);
var skeletonSpacePoint = skeletonAnimation.transform.InverseTransformPoint(worldMousePosition);
skeletonSpacePoint.x *= skeletonAnimation.Skeleton.ScaleX;
skeletonSpacePoint.y *= skeletonAnimation.Skeleton.ScaleY;
bone.SetLocalPosition(skeletonSpacePoint);
}
}
I purchased Spine Pro