skeleton_attachment_exists

This function returns if a custom attachment with the given name exists on the skeletal animation sprite.

 

Syntax:

skeleton_attachment_exists(name);

ArgumentTypeDescription
nameStringThe name of the attachment

 

Returns:

Boolean

 

Example:

if skeleton_attachment_exists("LegAttachment")
{
    skeleton_attachment_replace("LegAttachment", spr_leg_modified, 0, 0, 0, 1, 1, 0);
}
else
{
    skeleton_attachment_create("LegAttachment", spr_leg, 0, 0, 0, 1, 1, 0);
}

The above code first checks if an attachment named "LegAttachment" exists on the current skeletal animation sprite using skeleton_attachment_exists. If it does the attachment with that name is replaced using skeleton_attachment_replace. If it doesn't skeleton_attachment_create is called to create a new attachment named "LegAttachment".