Skip to main content

Overview

The Transform Object action changes an object’s position, rotation, or scale. You can apply transformations instantly (snap) or animate them smoothly over a specified duration. This is how you create dynamic movement within your training—sliding drawers, rotating valves, scaling up objects, and more.

Parameters

Key Behavior

  • Snap mode: The transform completes instantly. The object jumps to the new position/rotation/scale.
  • LinearInterpolation mode: The transform animates smoothly from the current state to the target state over the specified duration.
  • Simultaneous changes: You can move, rotate, and scale an object in a single action.
  • Non-blocking: The action doesn’t wait for the animation to complete. Other actions run immediately unless you add a Delay.
  • Spline paths: For curved movement (e.g., a ball rolling around a track), use waypoints instead of a direct position.

Practical Examples

Sliding Drawer Animation

Scenario: A maintenance training shows a technician opening a panel drawer. The drawer slides out smoothly over 2 seconds.
1
State InspectPanel onEntry:
  1. Load Scene: maintenance_room
  2. Play Audio: “Slide the access panel drawer to the right”
2
Learner clicks “Open Drawer” button, triggering transition:
  1. Transform Object:
    • Object: panel_drawer
    • Target Position: (2, 0, 0) — move 2 meters to the right
    • Transform Mode: linearInterpolation
    • Duration: 2000 (2 seconds)
  2. Delay: 2000 (wait for animation)
  3. Play Audio: “The panel is now open. Inspect the components.”
3
The drawer smoothly slides open, then narration guides the learner to inspect.

Instant Scale Change

Scenario: An object needs to change size instantly (e.g., a tool expands to full size when selected).
1
Transition triggered by clicking a tool:
  • Transform Object:
    • Object: magnifying_glass
    • Target Scale: (3, 3, 3) — scale up to 3× size
    • Transform Mode: snap (instant)
2
The tool instantly becomes larger, making details visible.

Rotating Valve Animation

Scenario: A valve must rotate 90 degrees to open. The rotation should animate over 1 second.
1
Learner clicks the valve, triggering transition:
  1. Transform Object:
    • Object: control_valve
    • Target Rotation: (0, 90, 0) — rotate 90 degrees around Y axis
    • Transform Mode: linearInterpolation
    • Duration: 1000
  2. Delay: 1000 (wait for rotation)
  3. Set Variable: valveOpen = true
2
The valve rotates smoothly, then a variable is set to record the action.

Curved Path Movement

Scenario: An object must follow a curved path (e.g., a ball rolling around a track or a tool moving along an assembly line).
1
Use Spline Path with waypoints:
  • Transform Object:
    • Object: assembly_part
    • Spline Path: [(0, 0, 0), (1, 2, 0), (2, 2, 1), (3, 0, 1)] (4 waypoints forming a curve)
    • Transform Mode: linearInterpolation
    • Duration: 4000 (4 seconds for the entire path)
2
The object smoothly follows the curved path from waypoint to waypoint.

Complex Multi-Transform

Scenario: An object needs to move, rotate, and scale simultaneously (e.g., a component being installed, twisted, and fitted into place).
1
Transition triggered by learner action:
  • Transform Object:
    • Object: gasket_component
    • Target Position: (1, 0.5, 0) — move into position
    • Target Rotation: (45, 0, 0) — twist 45 degrees
    • Target Scale: (0.8, 0.8, 0.8) — compress slightly for fitting
    • Transform Mode: linearInterpolation
    • Duration: 2500 (2.5 seconds)
2
All three transformations animate in parallel, creating a realistic installation motion.

Undo/Reset Motion

Scenario: An object animates to a position. If the learner chooses “undo,” animate it back to the original position.
1
Original position of lever is (0, 0, 0).
2
Action: Learner pulls lever → animate to (1, 0, 0) over 1 second.
3
If learner clicks “undo”:
  • Transform Object:
    • Object: lever
    • Target Position: (0, 0, 0) — back to start
    • Transform Mode: linearInterpolation
    • Duration: 1000
4
The lever animates back to its original position.
For smooth animations, use linearInterpolation with durations of 1–3 seconds. Faster (< 500ms) can feel jarring; slower (> 5s) can feel sluggish.
Transform animations are purely visual. If an object has physics or collision, these are not updated during animation in real-time—the collision will snap to the final position when the animation completes.
If you transform a parent object while it has child objects, the children move and rotate with it. Be careful with parent-child hierarchies during complex animations.