Targets & Constraints

10–15 minutes · Requires Bones & IK and State Machines

A target is a point or region on the canvas that your artwork can respond to. A constraint links a bone to something else, so it follows without keyframes. Together they make a character react to a finger.

Cody, the bear on the Kineto homepage, uses both: his pupils follow your finger, and his eyes wink when you tap them.

Targets

Pick Target in the tool rail. Tapping places a point. Dragging, or tapping Make Region in the inspector, gives the target an Extent: a rectangle with a width and height. Collapse to a Point turns it back.

What a target does

Under Interaction, a target has one of three modes:

Mode What it does
Drives a value Moving the point sets a value, such as an input
Reacts to taps The region catches touch and changes inputs on press and release
Exposes pointer The target goes where the pointer is, so bones and constraints can use that position

Example: tap to wink

Each of Cody’s eyes has a small region set to Reacts to taps. Catches touch is on, and two reactions change tapped-left-eye: Down when you press and Up when you release. The state machine does the rest.

Cody with a target region selected over his left eye. The inspector shows left-eye-target set to Reacts to taps, with Catches touch on and two reactions, Up and Down, that toggle tapped-left-eye.
A region over the eye turns taps into input changes.

Example: eyes that follow a finger

A third target, Eye tracking target, covers the whole artboard and is set to Exposes pointer:

  • Scope is Within own extent, so only a finger inside the region moves it. The other option is Anywhere on canvas.
  • Feel is Smooth. Snap lands on the pointer at once, and Spring overshoots before settling.
Cody with a target region around the whole artboard. The inspector shows Eye tracking target with an extent of 1086 by 1081, Exposes pointer switched on, and the scope Within own extent.
The eye tracking target covers the whole artboard.

Constraints

Select a bone and tap Add Constraint in the inspector. The types are grouped by what they do:

Constraint What the bone does
Translation Follows position
Rotation Turns with the target
Scale Grows with the target
Copy All three at once
Aim Points at the target
Distance Stays within reach

Transform and Follow Path are also in the list. Every constraint has a Strength: at 100% it applies fully, and lower values blend it.

Example: pupils that stay in the eye

Each of Cody’s pupils is attached to its own bone, and that bone has two Distance constraints:

  1. Stay near the eye tracking target, at about 20%. The pupil leans toward your finger, but only a little.
  2. Stay near its eye shape, at 100%. The pupil can’t leave the eye, however far away your finger is.

No keyframes are involved, so the pupils respond for as long as you move.

A bone selected in Cody's left pupil. The inspector lists two Distance constraints: Stay near Eye tracking target at 20 percent and Stay near Path at 100 percent. A circle on the canvas shows the reach.
Two Distance constraints on the pupil's bone.

Test it

Open the fullscreen Test Preview in the Logic tab. Hit areas shows each region in a color for what it does, so you can see what a finger can touch.

The fullscreen Test Preview with Cody, two highlighted hit areas over his eyes, a legend of hit area types, the inputs and an empty event log.
The fullscreen preview draws what a finger can touch.

Common mistakes

A tap does nothing

Check that the region is set to Reacts to taps, that Catches touch is on, and that it has reactions.

A bone follows too strongly

Lower the constraint’s Strength.

The bone leaves the area it should stay in

Add a second constraint that limits it, as Cody’s pupils do. Check the result in the preview.

What to learn next