Ligamen

Attachments

Point

A point attachment is a marked place on a bone: a position and a direction, nothing more. It has no image, no outline and no size, and it draws nothing in the game. Its job is to give your game code a spot to hold on to, such as the muzzle of a gun, the hand that carries a sword, the spot where a spark or a footstep puff should appear. The code asks the skeleton where the point is and gets a position and an angle that already include every bone transform and the animation. This article explains how to create a point, how to place and turn it, what the panels show, and how a point behaves in an animation and in the game.

Point

Creating a point#

In the Tree, open the New... menu on a bone and choose Point. A dialog asks for a name, and the suggestion starts with the bone name, so a point on arm is offered as arm-point. Press Create and Ligamen adds a new slot under the bone, puts the point in it as the slot's attachment and selects it. The slot and the point share a name. You can also right-click an existing slot and choose New Point to add the point to that slot (see Slots). Creating a point is one undo step.

A new point sits at the origin of its bone and looks along the bone's own axis, so it is easy to find. Because a point is stored in the local space of the slot's bone (see Bones), it travels with that bone: move, rotate or scale the bone and the point follows. A point is not drawn in the game, so where its slot stands in the draw order does not matter.

What a point looks like#

In the viewport a point is a small ring with a short line coming out of it. The ring is the position and the line is the direction in which the point looks. The angle is turned by the rotation of the point plus the rotation of its bone, so the line keeps its meaning when the bone turns. The default colour is yellow, and the colour never reaches the game. A selected point is drawn with a thicker outline.

A point is a small target that you pick the way you pick a bone: click it with the select tool, or click its row in the Tree. A second click in the same spot cycles on to whatever lies underneath (see User interface). If a point is in your way, open the card at the top of the Tree and turn off Select under Options: the point stays visible but can no longer be clicked in the viewport, and you can still select it from the Tree.

Placing and turning a point#

A point is placed in Setup. Select it and choose Translate in the toolbar at the bottom of the viewport. Drag the centre of the gizmo to move the point freely, or drag one of the axis arrows to move it along that axis. Choose Rotate and drag the ring to turn the point. Every drag is one undo step, and the move and rotate fields of the toolbar show the same values as you work (see Tools).

For exact work use the Properties panel. Its Transform section has Position, where X and Y are pixels in the local space of the bone, and Rotation, an angle in degrees measured from the bone's own X axis. Type a value and press Enter. Each edit is one undo step and nothing happens if the value is the same. The fields are available in Setup only.

A point can also take part in copy and paste of transforms. Select it, press Ctrl+C (Cmd+C on macOS) in the viewport, select another point or a region and press Ctrl+V. The Local / Parent / World switch decides in which space the values are copied and pasted, so you can put a muzzle point exactly where another point is, whatever bone it belongs to (see Region).

What the panels show#

The Properties panel has a Point section with three read-only rows. Name is the name of the attachment, Slot is the slot that holds it and Bone is the bone the slot belongs to. The bone matters most: it is the bone whose movement the point inherits. Below it the Transform section holds the numeric fields from the previous section.

The card at the top of the Tree has Options and Color. Select decides whether the point can be picked in the viewport. Export leaves the point out of exported files when you turn it off, which is useful for a marker that only helps you while you work. Color changes the colour of the ring in the editor. The Tree shows the point in its own row under the slot, and the type filter of the Tree has a Points entry, so you can hide them when the list gets long.

Animation and the game#

A point has no keys of its own. In Animate mode the numeric fields are disabled and the gizmo does not move the point: what moves is the bone, and the point follows it (see Keys and Animating). If a spark must appear at a different place at different moments, either animate the bone that owns the point or put the point on a different bone. For a mount that must switch between two spots, make two points and let the code choose.

Points are written to Spine JSON, to the binary skeleton and to the Unity package, and a point with Export off is left out of all of them. In Unity the LigamenPointFollower component sets a transform to a point of a slot at the end of every frame: it takes the position and rotation and can mirror the follower when the skeleton is flipped. Choose the slot and the point in the Inspector from the lists of names of your skeleton. The point is found in the skin even while the slot hides it, so a point on an empty slot works as a socket that is always there.