Trigger Basics

A trigger is an object you place in your Maya scene. You use triggers to detect when the viewer's camera is pointing a certain direction, or is getting close to something.

This is important if something happens in your story that you don't want the viewer to miss. For example, if you want to be sure that the viewer is looking at a mouse before he starts to move around, you can put a trigger at the same location as the mouse. Then you can set up your story to wait until the viewer looks at that trigger before starting that animation clip.

Visible Trigger Example

In this image, we've highlighted the trigger (the bubble around the mouse) and where the camera is pointing (the small red circle). In your story, the bubble and small circle will not be visible.

To get you started, we suggest watching this short video about how to use triggers in a Spotlight Story.

How do triggers work?

When the viewer's camera interacts with a trigger, it sends a message or event. You can set up actions, transitions, and conditions to listen for these events which control the timing and flow of your story, like when to start a new animation clip or play a sound.

The story will continue to get event messages as long as the camera is interacting with a trigger. So you will know when the interaction starts and when it stops.

For more information on using the events that a trigger sends to your story, see Events.

Adding a trigger to your Maya scene

To add a trigger to your story, simply add a volumetric sphere to your Maya scene. Any volumetric sphere in your scene will automatically be detected as a trigger when you import the scene into the Story Editor.

Trigger objects

In Maya, you can add a volumetric sphere using the Create menu: Create > Volume Primitives > Sphere.

A few things to keep in mind:

  • A trigger must be a volumetric sphere.
  • Triggers will not be visible in your story. But you can make them visible in the Story Viewer during playback if you wish.
  • We recommend that you give the sphere a name that associates it with its corresponding location or action, and which will be easy to recognize later.

Trigger Spheres

Trigger spheres can be any size you choose. It is a good idea to make it large enough that the viewer won't be likely to miss it.

Note that moving a sphere's pivot point in the Maya scene does not affect its position as a trigger.

Grouping triggers

If you need a trigger that is a different shape than a sphere, you can group trigger spheres together in Maya to approximate the shape you need.

Trigger Group

For the Story Editor to recognize the spheres as a single trigger:

  1. Select the spheres and group them using the Edit > Group command.
  2. Click on the "Mark trigger root object" tool in the Spotlight Stories shelf. Trigger Group

The attribute "Moxie Trigger" appears under Extra Attributes the group, and the name of the group appears in the Story Editor as the name of the single trigger.

Group triggers with an actor

If you group an actor (geometry) with one or more volumetric spheres, the spheres will appear as a single trigger with the same name as the parent actor.

Animating triggers

You can animate the position of triggers as your story progresses. Simply animate the translate parameter of your volumetric spheres or sphere groups.

Using a trigger in the Story Editor

When you import your Maya scene into the Story Editor, any triggers (volumetric spheres) in your scene appear in the Outliner under Sources. Click on a trigger name to see its properties in the Properties window.

Enable trigger types

When you enable your story to use the different types of triggers, any time the camera interacts with a trigger, your story will get an event message.

In your story's Properties window, there is a Trigger Interaction section where you can enable the types of trigger interactions that your story can use.

First, make sure Use Legacy Triggers is turned off. (For more information on legacy triggers, see below.) Then check on each of the interaction types you wish to enable:

  • Use Raycast: A trigger will activate when the viewer's camera is pointed directly at it.
  • Use Frustum: A trigger will activate when it comes in contact with the camera's frustum field.
    • Frustum Scale: Increase or decrease the scale to expand or restrict the area of interaction. For example, you may want to wait until a trigger is within the center 80% of the frustum field.
  • Use Camera Sphere: The camera has a sphere of influence around the viewer's position. A trigger will activate when it comes in contact with the Camera Sphere.
    • Camera Sphere Radius: Increase or decrease the radius to expand or restrict the area of interaction. For example, you may want an interaction to start when the trigger is still some distance away from the camera.

You can also enable the Use Controller Ray trigger interaction. A Controller Ray trigger is activated by pointing the hand controllers you use with a VR setup at the trigger. To enable the Use Controller Ray interaction, check the box in each individual trigger, as described below.

Set individual trigger types

After you enable the trigger interactions on a story level, you can decide what types of interactions each trigger will accept.

In the Outliner window, under sources, click on a source to see its components, including Triggers. When you click on a trigger name, in the Properties window you will see another Trigger Interaction section.

Decide, for each type of trigger, if you want to include that interaction. Then enable the ones you want:

Trigger Spheres

  • Use Raycast: A trigger will activate when the viewer's camera is pointed directly at it.
  • Use Frustum: A trigger will activate when it comes in contact with the camera's frustum field.
  • Use Camera Sphere: A trigger will activate when it comes in contact with the Camera Sphere.
  • Use Controller Ray: A trigger will activate when you point a VR controller at it.

Tip: Using triggers to change environments

Beyond using triggers to launch simple events like starting an animation clip, you can also use them to change environments or sets. Using traditional camera techniques may not be effective in a Spotlight Story.

If you are interested in learning more about these techniques, we have a video to introduce them.

Legacy triggers

Older versions of the SDK used only Raycast trigger interaction. Using an old story with a newer version of the SDK may cause problems with your triggers.

If you created a story using one of the older SDK versions, enable the Use Legacy Triggers option in the Story properties to preserve that functionality.