Skip to main content

Overview

The Add Object and Remove Object actions allow you to spawn or despawn 3D objects during training execution. Unlike objects placed in the Scene Editor (which exist when the scene loads), these actions add or remove objects programmatically in response to learner actions or training events.

Add Object

When to Use

  • Dynamic spawning: create tools or components only when needed
  • Conditional content: show objects based on learner choices or training path
  • Task rewards: spawn a completed item after learner successfully completes a step
  • Progressive complexity: add new objects as the training advances
  • Collision or pickup mechanics: add items the learner can interact with or collect

Parameters

ParameterTypeRequiredDescription
Asset to AddstringYesSelect a 3D object from your asset library. This becomes the new object in the scene.
PositionX, Y, ZNoLocation in 3D space where the object spawns (in meters).
RotationX, Y, ZNoOrientation of the object (in degrees). Default is (0, 0, 0).
ScaleX, Y, ZNoSize of the object. Default is (1, 1, 1) — the asset’s native size.
Parent ObjectstringNo(Optional) Make the new object a child of another object in the hierarchy. The new object will move/rotate with its parent.

Key Behavior

  • Immediate: The object appears instantly in the scene.
  • Hierarchy: If you specify a Parent Object, the new object becomes a child and inherits transformations from its parent.
  • Referenced later: Once added, the object can be referenced in other actions (Transform Object, Set Object Visibility, etc.).

Remove Object

When to Use

  • Cleanup: remove objects that are no longer needed
  • Destruction simulation: remove broken or discarded items
  • Dynamic scene management: reduce scene complexity by removing objects
  • Reset workflows: remove spawned objects to return to a clean state

Parameters

ParameterTypeRequiredDescription
Target ObjectstringYesSelect the object (from the scene hierarchy) to remove. This object is deleted from the scene.

Key Behavior

  • Permanent removal: The object is completely removed from the scene and cannot be restored (unless you Add it again).
  • Children affected: If you remove a parent object, all child objects are also removed.
  • References cleared: Any action referencing the removed object will have no effect if the object no longer exists.

Practical Examples

Spawn a Tool When Needed

Scenario: A learner must pick up a wrench to complete a repair task. The wrench doesn’t exist initially; it spawns when they click “get tool.”
1
Create a state called ToolSelection.
2
Add a button “Get Wrench” that triggers a transition with an action list:
  1. Add Object:
    • Asset to Add: wrench
    • Position: (1, 1, 0) — in front of the learner
    • Rotation: (0, 45, 0) — rotated for visual interest
  2. Set Variable: hasWrench = true
3
The wrench appears in the scene, and a variable tracks that it’s available.

Progressive Object Addition

Scenario: An assembly training adds components one step at a time as learners complete each step.
1
Step 1: Learner assembles the base.
  • Add Object: assembly_base (position: 0, 0, 0)
2
Step 2: Learner adds the first component.
  • Add Object: component_a (position: 1, 1, 0, Parent Object: assembly_base)
3
Step 3: Learner adds the second component.
  • Add Object: component_b (position: -1, 1, 0, Parent Object: assembly_base)
4
Each component spawns as a child of the base, creating a growing assembly.

Remove After Failure

Scenario: If a learner makes a mistake, remove the incorrectly placed object and reset them to try again.
1
Learner places an object in the wrong location.
  • Trigger a “mistake” condition in a transition.
2
In the transition’s action list:
  1. Remove Object: Target Object: misplaced_item
  2. Set Variable: attempts = attempts + 1
  3. Play Audio: error_sound.mp3
  4. Transition back to the task state
3
The object is removed, the attempt is recorded, and the learner can try again.

Cleanup on State Exit

Scenario: A state spawns temporary objects (scaffolding, indicators, markers) that should be removed when exiting.
1
In a state’s onEntry:
  1. Add Object: left_marker (position: -2, 0, 0)
  2. Add Object: right_marker (position: 2, 0, 0)
2
In the onExit:
  1. Remove Object: left_marker
  2. Remove Object: right_marker
3
Markers appear during the task and are cleaned up when the learner moves to the next state.
Use descriptive naming for spawned objects to make your action list easier to read and debug. Instead of “object_1”, use “wrench_task_item” or “assembly_component_a”.
Objects added via Add Object actions don’t persist if the scene is reloaded. If you reload the scene (e.g., via a Reload Training action), all dynamically added objects are removed.
Removing an object that is referenced in other active actions (like Transform Object in progress) may cause errors. Always ensure cleanup happens at appropriate times, typically in state onExit actions.