Remove Action

A Remove Action defines the behavior of grabbing an object and removing it from its position.

../../_images/new_remove_action.gif

How to Setup a Remove Action

In this tutorial we will make a Remove Action to remove a pills bottle from the shelf.

  1. Right-click on the Scenegraph editor.

  2. Select New Action > Remove Action.

    ../../_images/remove_action_creation.png
  3. The Remove Action node will appear. Link it with the rest of the nodes.

    ../../_images/remove_action_node.png
  4. Create the Remove object. This is the interactable object that we will remove to complete the Action. This object will spawn when the Action initializes. In our case we will use a pills bottle. We place it in the shelf.

    ../../_images/remove_action_object.png

Note

It’s important to add physical colliders to the object. The colliders refer to the Collider Component that you can add to your object by clicking the Add Component button in the inspector of your prefab or GameObject. It’s crucial to use the appropriate colliders and adjust them to match your GameObject’s shape.

../../_images/collider_component2.png
  1. Save the Remove Object as a prefab to your assets and drag it to the Remove Object field in the Action node.

    ../../_images/remove_action_object_node.png

Note

To save the Remove Object as a prefab, drag the object from the Scene Hierarchy in your Unity Editor and place it inside your Assets. It is strongly advised to place your prefabs under a Resources folder. For example, in our case: Assets > Samples > MAGES - Core > 1.0.0 > Example Scene > Resources > Prefabs > MedicineBottle.

  1. Name the Action, e.g., “Remove the pills bottle”.

See also

  1. The Axis to lock dropdown to restrict the object motion in a sigle axis. This is mostly used for objects that are pull out from bottles or other examples that are restricted in an axis.

  2. The Distance to Unlock parameter sets a the distance that you need to pull the object in order to release it from the axis lock.

  1. Remove any prefabs you created from the scene and save the Scenegraph.

How to Perform

The Action performs when the user takes the pills bottle out of the shelf and releases it.