Previous Document Next Document

Interaction > Example: Click a button to launch an animation

Example: Click a button to launch an animation


In this example, we animate the scaling of a cube, then convert the animation into a reaction. We then place a sensor on a sphere and link the animation reaction to that sensor. When a surfer clicks the sphere, the animation plays.

Create a reaction:
  1. Animate the scaling of a cube growing bigger over a couple of seconds. See To animate position, rotation, or scale:.
  2. When you turn on Play, the cube grows bigger.

  3. In the Sequencer, select the animation, then choose Interaction > Reactions > Play Animation.
  4. The animation is now a reaction waiting to be triggered. It appears in the Interaction Editor. In the Parameter Editor, notice how the animation is no longer active. If you turn on the Play button, the animation does not play back.

Link a sensor to the reaction:
  1. Create a sphere and translate it to side of the cube.
  2. With the sphere selected, choose Interaction > Sensors > Mouse.
  3. This places a mouse sensor on the sphere. The new sensor appears in the Interaction Editor.

  4. Expand the mouse sensor, then drag from OnLeftClick to PlayAnim.
  5. Switch to Browse mode to test the interaction. Click the sphere to launch the scaling animation.

See also:

Creating reactions

Creating sensors

Linking Sensors and Reactions

To change the cursor associated with a sensor:

Editing Triggers

The Interaction Editor

Previous Document Next Document