I need to generate the Godot .tscn file based on the exported .json file, but I am unable to use "Runtimes".
After processing the vertices, I am unsure how to use them to generate data in the Godot Polygon2D node
If the exported coordinates are used directly, the generated points will always be incorrect.
After comparing with the Spine Web Player version, it is confirmed that the processed data is correct.
May I ask if I have missed any key information?
raw data
processed data
Spine Web Player version data
The points generated now
How should I use the 'vertices' in Attachments ->mesh
When working with mesh attachments in Spine, the vertices are defined relative to the parent bone. To correctly use these vertices in Godot's Polygon2D
node, you need to ensure that the vertex positions are transformed from the local coordinate space of the attachment to the global coordinate space of the SpineSprite
. This involves applying the bone's transform to each vertex. If the vertices appear incorrect, it might be due to not applying the correct transformations or not considering the pivot point of the mesh. Make sure to apply the bone's world transform to each vertex to position them correctly in Godot's coordinate system.