Tutorial: Composing Transform Moves with Transformer¶
Drive structured, multi-step transform moves on one or many subjects from a single component. Where transform operations on an AttachmentPoint shape a single attach/detach motion, a Transformer hosts a list of subject + operation pairs that begin and end 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 — all without scripting.
Prerequisites: A scene with one or more Transforms you want to drive. 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 a subject (scale up → translate → scale back).
- You want to drive many subjects in parallel under one execution frame.
- You want a place to fire a completion process when the move finishes.
When you just want "snap this cube into the slot on attach", stay with the inline transform operation on the AttachmentPoint.
1. Add the Transformer¶
Create an empty GameObject named CubeAnimator (or attach the Transformer to an existing controller GameObject). Add the Transformer component.
Add Component → Jungle → Spatial → Transformer
The Inspector shows an Entries list. Each entry is a TransformerEntry:
| Field | What it is |
|---|---|
| subject | The object this entry drives (a SmartGameObject). Its transform is handed to the operation. |
| root | The operation that runs on the subject. Single op or a Sequence/Parallel composition. |
| onCompleted | Optional fire-and-forget process invoked when the root finishes. |
2. Wire One Subject + One Operation¶
- Click
+on Entries. A new entry appears. - subject — drag your Cube in (or wire any GameObject source).
- root — pick Direct Transform Operation for a quick start. Configure its target (e.g. another Transform marking the destination).
When the Transformer begins (default frame: on enable), the entry's root operation begins. When the Transformer ends, every running root completes.
Press Play. The cube moves to the target.
3. Compose a Multi-Step Move with Sequence¶
Replace the entry's root with a Sequence Transform Operation. The Sequence has a list of children — they run one after the other on the same subject.
Add three children:
- Direct Transform Operation targeting a "scaled up" Transform (e.g. the cube's own transform with scale
(1.5, 1.5, 1.5)). - Direct Transform Operation targeting the destination.
- Direct Transform Operation targeting "scaled down" (back to
(1, 1, 1)).
Now on Begin, the Transformer runs step 1 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 advances to the next child the moment the current one reports IsComplete.
4. Run Several Things at Once with Parallel¶
Sometimes you want move + rotate happening at the same time. Replace the root with a Parallel Transform Operation. Its children all begin together; the parallel completes when all children complete.
A typical hybrid: a Sequence with a Parallel inside it — "scale up, then simultaneously slide and rotate, then scale back".
5. Broadcast a Completion Signal¶
On each entry, onCompleted runs fire-and-forget when the root finishes. Drop a Raise Signal On Owner Transmitter operation here to broadcast that this subject's move is done. Any Reactor listening on that signal can react — play a sound, spawn an effect, advance a state machine.
Transformer
└─ Entry
├─ subject: Cube
├─ root: Sequence(scale-up → slide → scale-down)
└─ onCompleted: RaiseSignalOnOwnerTransmitter(MoveDoneSignal)
6. Drive Many Subjects Under One Frame¶
Add more entries — each pairs its own subject with its own root. They all start when the Transformer begins, run in parallel with one another, and the Transformer's OnEnd completes any still-running root.
This is the bridge between "shape one motion" (modifier on an operation) and "shape one event of many motions" (Transformer): a Transformer is the right tool when several subjects need to move together as a group with a shared begin/end.
7. Hook Up the Execution Frame¶
The Transformer inherits its lifecycle from ControllableComponent. The default frame is on enable / on disable. Other useful frames:
- Mono Lifecycle Frame with
Start— run once on scene start. - Targeted Cycle Frame subscribed to an AttachableObject's
Attachedcycle — run while the attachable is attached. - Event Frame — begin on one
IEvent, end on another. Use for "play the move on button click, finish naturally".
The execution frame doesn't change what the Transformer does — it changes when it does it.
8. Transformer vs AttachmentPoint Process¶
| Surface | When to use |
|---|---|
| AttachmentPoint inline process | The motion is tied to an attach/detach. The point owns the recipe. |
| Transformer component | The motion is its own concern — independent of any attachment, or driving several subjects at once. |
A common pattern: AttachmentPoint runs the snap-to-position on attach; a separate Transformer runs a celebratory bounce on the same subject when a higher-level signal fires.
Next Steps¶
- Transform Operations tutorial for the modifier catalog.
- Constrainer tutorial for keeping moves inside a region.
- Transformer reference for the full API.