Skip to content

Tutorial: Composing Transform Moves with Transformer

Drive structured, multi-step moves on one or many objects from a single component. Where transform operations on an AttachmentPoint shape one attach or detach motion, a Transformer runs moves of its own that start and stop together.

By the end of this tutorial you'll have a Transformer that, on enable, scales a cube up, slides it to a target, and scales it back, without scripting.

Prerequisites: A scene with one or more objects you want to move. The Transform Operations tutorial is good background but not required.


When to Use a Transformer

Pick a Transformer when:

  • You want a scripted sequence of moves on an object (scale up, then slide, then scale back).
  • You want to move several objects together, starting and stopping at the same time.
  • You want something to happen when the move finishes.

When you just want "snap this cube into the slot on attach", stay with the transform operation on the AttachmentPoint.


1. Add the Transformer

Select your Cube and use Add Component → Jungle → Spatial → Transformer.

Field What it is
Objects What moves. It starts as the Cube.
Motions The movements it can play. It starts with one, without a name, with Auto Start on.

2. Add One Move

  1. In the first motion, pick Direct Transform Operation as the Movement.
  2. Set its target, for example another object marking the destination.

A motion with Auto Start on plays when the Transformer starts (by default, on enable). When the Transformer stops, any move still running finishes at once.

Press Play. The cube moves to the target.


3. Compose a Multi-Step Move with Sequence

Replace the operation with a Sequence Transform Operation. Its children run one after the other on the same object.

Add three children:

  1. Direct Transform Operation targeting a "scaled up" pose (scale (1.5, 1.5, 1.5)).
  2. Direct Transform Operation targeting the destination.
  3. Direct Transform Operation targeting "scaled down" (back to (1, 1, 1)).

Now on start, step 1 runs to completion, then step 2, then step 3.

Defining 'completion'

A transform operation completes when its target is reached. For an instant DirectTransformOperation, that's immediate. For a LerpedTransformTarget or curve-driven target, it's when the duration elapses. The Sequence moves on the moment the current child reports it is complete.


4. Run Several Things at Once with Parallel

To move and rotate at the same time, use a Parallel Transform Operation. Its children all begin together, and it completes when all of them have.

A typical mix: a Sequence with a Parallel inside it, "scale up, then slide and rotate together, then scale back".


5. Do Something When the Move Ends

Watch the Transformer from a Reactor: add a Bool reaction on Transformer Moving and run your step when it turns false. Play a sound, spawn an effect, advance a state machine.

To start the move from a sequence and wait for it instead, give the motion a name and use a Transformer Command with Play Motion: it finishes when the move does.

Process Component
└─ Process List (sequential)
    ├─ Transformer Command: Play Motion "Bounce"
    └─ Raise Signal On Owner Transmitter (MoveDoneSignal)

6. Move Several Objects Together

Point Objects at a list or a group instead of the Cube. Every object plays the motion, each on its own, and they all start and stop with the Transformer.

To play a motion on one object only, such as the one just grabbed, use Play Motion with All Objects off. The others keep doing what they were doing.


7. Choose When It Runs

The Transformer's Start & Stop section decides when it starts and stops (see ControllableComponent). The default is on enable and on disable. Other useful choices:

  • Mono Lifecycle Frame with Start: run once when the scene starts.
  • Targeted Cycle Frame on an AttachableObject's Attached cycle: run while the object is attached.
  • Event Frame: start on one event and stop on another, for example "play the move on button click".

Starting it again while it runs restarts the move from where each object is now.


8. Transformer vs AttachmentPoint Process

Surface When to use
AttachmentPoint process The motion belongs to an attach or detach. The point owns the recipe.
Transformer The motion is its own concern, separate from any attachment, or moves several objects at once.

A common pattern: the AttachmentPoint snaps the object into place on attach, and a separate Transformer plays a celebratory bounce on it when a signal fires.


Next Steps