Named Events
Named events allow you to trigger a certain action on an object either when the user taps on it or within a predefined interval of time. This behavior consists of two paired components - an event generator and an event handler.

Available event generators include:

• Generate Named Event on Timer
• Generate Named Event on Click

Available event handlers include:

• Play/Pause Media on Named Event (available for audio and video content)
• Change Material Variant on Named Event (available for 3D models)

Generate Named Event on Timer allows you to repeatedly trigger an action with a set interval between each activation.

For example, it can be used to play a certain sound every 5 seconds.
1
To get started, you'll need to add an audio or video file to your scene. In this example we will use a short sound effect from the built-in sound library.
2
Once the object is added, make sure that it's selected on the objects panel on the left, then click on the Add Action button on the right panel.
3
Scroll down to see the Generate Named Event on Timer or find it using the search field. Click on it to add the action to your object.
Once the action is added it will appear on the Properties panel on the right and you will be able to configure its settings, including:

Event Name - this is the name that you will need to reference later in the event handler

Number of Iterations
- sets how many times the action will be triggered (the default value of -1 will make it run indefinitely)

Timeout in Seconds - sets the length of the delay between the iterations
4
Now that the generator is added, we'll need to add an event handler to play the sound based on the timer we've created.

Click on the Add Action button again and find the Play/Pause Media on Named Event handler.
5
Make sure that the Event Name field has the same value in both the Play/Pause Media on Named Event and Generate Named Event on Timer.
Now the sound effect will be played every 5 seconds as long as the experience is running.

Don't forget to publish your experience to make the changes live.
Related Topics: