Skip to main content

Starting positions and axes

The Kinematic Editor Tool makes parts of a machine move: a slider that slides, a lever or door that swings, a wheel that spins. Each part moves smoothly between limits you set, and stops there by itself. Nothing else in the scene can push it, so it always moves exactly as set up.

New to Unity? The basic terms (Scene, Hierarchy, Play mode) are explained in Before you start.

What you need​

  • The machine in your scene, for example placed with Object Spawner.
  • Separate parts. The part that moves must be its own object inside the machine. In the Hierarchy, click the arrow next to the machine to see its parts.

Put the parts in their starting position first​

All limits are measured from where the part is when the scene starts. Before you set up a movement, put the part in its starting position: the door closed, the slider at its end, the lever up.

The window​

In Unity's top menu, choose ALF > Interactivity > Kinematic Editor Tool. The window has four steps:

StepWhat you do there
1 ObjectDrag the machine from the Hierarchy into Drag object here ->.
2 PartClick the part that should move in the Object hierarchy list. Target Object shows your choice.
3 MovementAdd a movement to the part and set it up under Customization settings.
4 ControlsOptional: build a panel of buttons that moves every part.

ALF > Interactivity menu with Kinematic Editor Tool highlighted

To set up several parts of one machine, go back to step 2 Part, click the next part, and set it up in step 3 Movement.

Axes: X, Y and Z​

Every object has three directions:

AxisColour in the Scene viewUsually means
Xredleft and right
Ygreenup and down
Zblueforward and back

You'll choose one of these for each moving part. They're measured along the axes of the part's parent, the object it sits inside in the Hierarchy, not the world's.

Seeing the parent's axes

Select the parent object and look at the coloured arrows in the Scene view. Make sure the toolbar is set to Local rather than Global, so the arrows follow the object's own rotation.

One movement per part​

A part can have one movement: sliding or turning. To combine them, for example a part that slides and also turns, split it into two objects, one inside the other, and give each its own movement.

To change a part's movement, press Remove Kinematic Movement Script in step 3 Movement, then add the other one.