A Point is a PointAttachment
object in the runtime.
You get it like other types of attachments.
Here's a sample dummy class.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Spine;
using Spine.Unity;
public class FindPoint : MonoBehaviour {
public SkeletonAnimation skeletonAnimation;
[SpineSlot]
public string slotName;
[SpineAttachment(slotField:"slotName")]
public string attachmentName;
void Start () {
Attachment attachment = skeletonAnimation.Skeleton.GetAttachment(slotName, attachmentName);
if (attachment == null) {
Debug.Log("attachment not found");
return;
}
PointAttachment pointAttachment = attachment as PointAttachment;
if (pointAttachment == null) {
Debug.Log("attachment is not a PointAttachment");
return;
}
Slot slot = skeletonAnimation.Skeleton.FindSlot(slotName);
Vector3 unityWorldPosition = pointAttachment.GetWorldPosition(slot, skeletonAnimation.transform);
float rotation2D = pointAttachment.ComputeWorldRotation(slot.Bone) + skeletonAnimation.transform.rotation.eulerAngles.z;
}
}
Oh, I almost forgot. There is also a "PointFollower" component.
To create a new PointFollower GameObject, open the context menu of SkeletonAnimation by clicking on its gear icon in the inspector, and choose "Add PointFollower GameObject". Then set its field values.
If all you wanted was a GameObject that follows a Point attachment, this is likely the good solution for it.