Hello, I have a need to get the position of a character's hand. This character is a circular animation, and the position I get now is a fixed value.
using System.Collections;
using System.Collections.Generic;
using Spine;
using Spine.Unity;
using UnityEngine;
public class test : MonoBehaviour
{
public SkeletonGraphic skeletonGraphic;
private BoneData bons;
private Bone bons2;
public SkeletonRenderer skeletonRenderer;
void Start()
{
skeletonGraphic = this.transform.GetComponent<SkeletonGraphic>();
// bons2 = skeletonRenderer.skeleton.FindBone("body_02");
// bons2.UpdateWorldTransform();
var exposedList = skeletonGraphic.skeletonDataAsset.GetSkeletonData(true).Bones;
foreach (var VARIABLE in exposedList)
{
if (VARIABLE.name == "body_02")
{
bons = VARIABLE;
// print(VARIABLE.parent);
// print(VARIABLE.X);
// print(VARIABLE.Y);
// print(VARIABLE.Rotation);
}
}
}
// Update is called once per frame
void Update()
{
// bons2 = skeletonRenderer.skeleton.FindBone("body_02");
// bons2.UpdateWorldTransform();
// bons2.GetWorldPosition(skeletonRenderer.transform);
print(bons.X);
print(bons.Y);
print(bons.Rotation);
}
}
The location of the printing remains unchanged. How can I get the change? Thank you.