Working with Interactions

In this article:

In Torch AR, an interaction is a unit of cause and effect. Interactions allow objects in your scene to dynamically respond to the user during Play Mode. An interaction is made up of a trigger event (the cause) and responses (effects) that happen when a user activates the trigger event. Interactions are powerful tools in Torch AR.

Adding an Interaction

Before you create an interaction, you need to decide which object you will add that interaction to. This is an important choice since ownership of an interaction cannot be moved from one object to another. Choose the object that you want to detect the user’s presence or action. For instance, if you want something to happen when the user taps an object, then make that object the owner of the interaction.

To create an interaction and add it to an object:

  1. Tap an object in your scene to select it. The object appears highlighted in blue.
  2. Tap the Interactions icon (the lightning bolt) in the context menu on the right side of the screen. The Interactions drawer opens and a list of all interactions on the selected object appear.
  3. Tip: If the interactions icon is not visible in the context menu, either you have no object selected or you have multiple objects selected. Interactions are only available when a single object is selected. You can disable Multi-select to ensure that you have only one object selected.

  4. Tap Add Interaction. The Trigger & Responses view opens.
  5. Tap the interaction name pill and type a name for the interaction. The default name for an interaction is “Select 1.”
  6. Set a Trigger Event for your interaction as described in Setting a Trigger Event below.
  7. Set one or more Interaction Responses as described in the Setting Interaction Responses section below.

Setting a Trigger Event

In the cause and effect of an interaction, a Trigger Event is the cause. When the user activates the trigger event of an interaction, this causes the responses of the interaction to occur.

To set a Trigger Event:

  1. From the Trigger & Responses view the Interactions drawer, tap the Trigger Event type that corresponds to your design for the interaction:
    • The Select Object trigger event is activated when the user taps the object that owns the interaction.
    • The Gaze At Object trigger event is activated when the user aims the center of the device screen at the object that owns the interaction.
    • The Gaze Away From Object trigger event is activated when the user was aiming the center of the device screen at the object that owns the interaction, then subsequently aims the center of the device screen away from that object.
    • The Enter Object Proximity trigger event is activated when the user comes within a specific distance of the object that owns the interaction.
    • The Exit Object Proximity trigger event is activated when the user was within a specific distance of the object that owns the interaction, then subsequently goes beyond that distance from that object.
  2. After you tap the Trigger Event type, the Trigger Settings view appears.

  3. Set the Trigger Repeat: If you want to limit the number of times that the user can activate this trigger event, tap the up arrow button until the correct number appears.
  4. Tip: Limiting trigger repeat is especially useful when used with a response that has a cumulative effect on an object property.

  5. If the Trigger Event type is Enter Object Proximity or Exit Object Proximity, set the Proximity Distance: enter the distance (in meters) into the value pill, or use the pinch gesture to resize the proximity sphere.
  6. Tap the check mark in the lower right. The Trigger & Responses view reopens. The Trigger Event type you selected is highlighted with a white outline and has a white gear icon in its upper right corner.

Setting Interaction Responses

After you have set a Trigger Event for an interaction, you can set one or more Interaction Responses for that interaction. You must set at least one Interaction Response, or the interaction will not work

There are two kinds of interaction responses: Scene Change responses and Trigger Receiver responses.

Setting a Scene Change Response

In the cause and effect of an interaction, one possible effect is a Scene Change response, which causes the user to leave the current scene and enter a different specified scene.

To set a Scene Change interaction response:

  1. From the Trigger & Responses view of the Interactions drawer, tap Change Scene. The Scene Response view of the Interactions drawer opens.
  2. Tap Scene Change. The Scene List and On Scene Change items appear.
  3. From the Scene List, tap the name of the scene pill that you want to change to. The selected scene pill highlights with a white outline.
  4. For the On Scene Change options, tap Reset this scene if you want to reset the current scene before moving on to the next one, or tap Change without reset if you want to leave the current scene in its current state when moving on to the next one. The circle above the chosen option highlights with a white outline.
  5. Tap the arrow in the lower left corner to return to return to the Scene Response view of the Interactions drawer.
  6. Tap the arrow in the lower left corner to return to the Trigger & Responses view of the Interactions drawer.

To learn more about scenes, check out Managing Scenes.

Setting a Trigger Receiver Response

In the cause and effect of an interaction, when an effect happens to an object, that object is known as the Trigger Receiver. The Trigger Receiver response is the effect itself, the change to the object’s properties in response to the cause. As the designer of the interaction, you define what this response will be and what object that happens to.

To set a Trigger Receiver interaction response:

  1. From the Trigger & Responses view of the Interactions drawer, look in the Set Interaction Responses section for a Trigger Receiver icon representing the object that you want to set a response for. If you find the icon, skip to step 3.
  2. Tip: The object that owns the interaction is always the default Trigger Receiver, and the first Trigger Receiver in the list. Setting an interaction response on the object that owns the interaction works exactly like setting an interaction response on any other object.

  3. If the object that you want does not yet have a Trigger Receiver icon, look over the edge of the Interactions drawer, to locate the object out into the scene, and then tap the object to select it. A Trigger Receiver icon for the object appears in the Set Interaction Responses list.
  4. Tap the Trigger Receiver icon for the object The Response Editor view of the Interactions drawer opens.

  5. Note: From this point, the method for setting responses on the Trigger Receiver object is nearly identical to the way that you would properties from the Object Properties drawer. This includes using gestures to modify properties. Use gestures as you normally would on the object in the scene while the Interactions drawer is open; the changes will be reflected in the Response Editor.

  6. For each object property that you want the interaction to change, tap it and set the new states and values that you want, then tap the check mark in the lower right to confirm.
  7. If you change the position, rotation or visibility of an object, you can choose if the change is Cumulative or Absolute. If you want the values you enter interpreted as a change from the property’s previous value, tap Cumulative. If you want the values you enter interpreted as usual (that is, as if you had set them in the Object Properties drawer), tap Absolute.
  8. After you have changed all object properties that you want for this response, tap the arrow in the lower left to return to the Trigger & Responses view.
  9. If you wish to use the advanced Response Curves editor, tap Edit Curves, otherwise tap the arrow in the lower left to return to the interactions list.
  10. Tap the X in the upper right of the Interactions drawer to close the drawer.
  11. (Optional) Tap the Play Mode icon in the context menu to enter Play Mode and experience the interaction that you just created.

Editing Response Curves

When a user activates a trigger event, all responses that change object properties happen first, followed by a scene change (if one is set). You can use the advanced Edit Curves feature to fine-tune the timing of your responses to give your project a more polished and refined feel.

For a response that changes an object property, you can specify a response delay in seconds from the time that the user activated the trigger event (this is available for all seven object properties). For responses that change position, scale, rotation and color, you can also specify a duration and a timing curve to control how the response will occur. Visibility responses always happen instantly (after any specified delay).

Removing Responses from Interactions

When you update your design, you may wish to remove one or more responses from interactions. How you remove or disable responses depends on what kind of response it is.

You can’t remove the Change Scene response from the Set Interaction Responses list. Instead, you can disable the scene change response.

To disable a scene change response:

  1. From the Trigger & Responses view of the Interactions drawer, tap Change Scene. The Scene Response view of the Interactions drawer opens.
  2. Tap Scene Change. The Scene List and On Scene Change items appear.
  3. From the Scene List, tap No scene change.

You can remove any of the Trigger Receivers from the Set Interaction Responses list except for the default Trigger Receiver. When you attempt to remove the default Trigger Receiver from the Interaction Responses list, the default Trigger Receiver will instead be reset to its initial state.

Note: Removing a Trigger Receiver from the Set Interaction Responses list does not delete or otherwise modify the object in the scene that corresponds to the Trigger Receiver.

To reset the default Trigger Receiver or remove any other Trigger Receiver:

  1. From the Trigger & Responses view of the Interactions drawer, find the icon for the Trigger Receiver that you want to reset or remove in the Set Interaction Responses list.
  2. Note: After you press your finger to the screen in step 2, keep it pressed to the screen until step 4 asks you to release.

  3. Press and hold on the Trigger Receiver icon. After a moment, a trash can icon appears in the bottom middle of the screen.
  4. Drag the Trigger Receiver icon toward the trash can icon. A red circle appears around the trash can icon.
  5. To cancel and not remove/reset the Trigger Receiver, drag the Trigger Receiver icon away from the red circle and release. To continue with the remove/replace, release the Trigger Receiver icon over the red circle. If the Trigger Receiver was the default Trigger Receiver, its icon appears back where it started; you can tap to open it and see that its responses have been reset. If the Trigger Receiver was not the default Trigger Receiver, then its icon is removed from the Set Interaction Responses list.

Deleting an Interaction

Instead of making many changes to an interaction in your design, you may wish to simply delete that interaction and replace it with a new one.

To permanently delete an interaction:

  1. Find the object in your scene which owns the interaction that you want to delete.
  2. Tap the object to select it. The context menu appears.
  3. Tap the interactions icon (lightning bolt). The Interactions drawer opens and a list of all interactions on the selected object appear.
  4. Tip:If the interactions icon is not visible in the context menu, either you have no object selected or you have multiple objects selected. Interactions are only available when a single object is selected. You can disable Multi-select to ensure that you have only one object selected.

    Caution: There is no undo for deleting interactions.

  5. Tap the interaction you want to delete and swipe left, then the tap Delete. The interaction is permanently deleted.

Still need help? Contact Us Contact Us