|slot||The slot name (a string) to get the attachment of.|
|attachment||The name (as a string or a sprite_index) of the attachment image.|
A skeletal animation sprite may have other images added as
attachments, with these images being added to a named slot (the
name is given when you create the attachment slot in your animation
program) and they will be drawn along with the animation of the
current sprite. With this function you can set an attachment to a
given slot, where you are required to give the names (as strings)
of the slot and the attachment. These names are defined by the
animation program used, or (in the case of the attachment) when you
Note that you can also pass a sprite_index in as the attachment, and that sprite will be used, or you can use -1 to remove the attachment from the slot.
IMPORTANT: Spine integration in GameMaker: Studio is a Pro licence feature and will not work in the Free/Standard versions.
if skeleton_attachment_get("slot_leftHand") ==
skeleton_attachment_set("slot_leftHand", choose("sword", "spear", "knife"));
The above code would check the currently assigned attachment name for the slot named "slot_leftHand" and if an empty string is returned, a new sprite is attached.