Previous Document Next Document

Interaction > Editing Triggers > Using a trigger to control a reaction

Using a trigger to control a reaction


Normally a reaction occurs when the surfer triggers it. For example, a door opens when you click the handle. You can use an Activate/Deactivate trigger to add another condition to the reaction occurring. For example, clicking the handle opens the door only if the surfer clicks a key first.

Use Activate triggers to force reactions to occur in a specific sequence. For example, clicking an object could launch different animations, depending on what you did previously.

Example: Use a key to control the reaction of a door opening when you click it
  1. Create an animation of a door opening. Select the animation, and choose Interaction > Reactions > Play Animation.
  2. Add a mouse sensor to the doorknob, and link it to the Play Animation reaction.
  3. Switch to Browse mode to test the interaction.
  4. When you click the knob, the door opens.

  5. Deactivate the reaction at time 0. Link Time Sensor / Time 0 to the Play animation reaction, then select the trigger and set the Trigger mode to Deactivate.
  6. In the Interaction Editor, notice the trigger is red to indicate that it deactivates the reaction. Also notice the icons are different from other triggers.

  7. Switch to Browse mode to test the interaction.
  8. When you click the knob, nothing happens because the reaction was deactivated as soon as the World opened at time 0.

  9. Now, use a key to activate the Play animation reaction. Create an object to use as a key, and add a mouse sensor to it.
  10. Link the mouse sensor on the key to the Play animation reaction. Select the trigger and set the Trigger mode to Activate.
  11. Notice the trigger color and icon indicate that it is in activate mode.

  12. Switch to Browse mode to test the interaction.
  13. Click the doorknob. Nothing happens because at time 0, the reaction was deactivated. Now click the key. This activates the Play animation reaction. Now when you click the doorknob, the door opens.

Previous Document Next Document