Is possible set to event position ? For exmaple to spawn the particles in unity.
Event position
Yes, it is possible to set an event position in Spine to trigger actions such as spawning particles in Unity. You can add event keys in the Spine editor at specific frames where you want the event to occur. In Unity, you can handle these events using C# code by adding delegates for the event. This allows you to execute custom logic, such as spawning particle effects, when the event is triggered during the animation. You can refer to the Spine Unity documentation on Processing AnimationState Events for more details on how to implement this.
Tobiasz2817 Since there is no concept of position in the Events that can be set in the Spine editor, I thought maybe what you were looking for were point attachments, so let me add something about that.
A point attachment is a point in space with a rotation. It can be used to spawn particles or anything else that involves a position and/or rotation. A bone could be used instead of a point attachment, but bones have other features like scale or shear that require a little more processing at runtime. In Unity, you can easily make any GameObject, such as a particle, follow the point by using the PointFollower
component: https://esotericsoftware.com/spine-unity-utility-components#PointFollower
Misaki Thanks for fast respond, is possible also read some how the reference of the point attachemets by name in Unity ?
Tobiasz2817 Yes, you can find point attachments, like other attachments, by using the attachment name and the slot name or slot index with the Skeleton getAttachment
method:
https://esotericsoftware.com/spine-api-reference#Skeleton-getAttachment
Misaki That should work, thank you for help
Sorry but i have one more question, to read position attachement i need use the follower ? Because didn't find anything in class Attachement to read the position of the attachement and wondering is maybe some better solution for it ?
PointAttachment has methods to get the world position:
EsotericSoftware/spine-runtimesblob/4.2/spine-csharp/src/Attachments/PointAttachment.cs#L58-L67