Menu
Lumberyard
User Guide (Version 1.14)

Audio Trigger

Component entity system is in preview release and is subject to change.

The Audio Trigger component provides basic play and stop features so that you can set up Audio Translation Layer (ATL) play and stop triggers that can be executed on demand. With an audio trigger, you can also enable the player to run or stop audio triggers by name on entities.

Audio Trigger Properties

The Audio Trigger component has the following properties.

Default 'play' Trigger

Type the name of the audio trigger that this component runs when 'play' is called. You can change this property to specify a different default audio trigger.

Default 'stop' Trigger

Type the name of the audio trigger that this component runs when 'stop' is called. You can specify any trigger here; you do not need to specify a 'stop' trigger in order to stop audio, but it is a best practice to pair the two triggers. If you leave this setting blank, the 'stop' trigger simply stops the audio trigger specified for 'play'.

Play immediately

Select this option to run upon component activation the audio 'play' trigger.

EBus Request Bus Interface

Use the following request functions with the EBus interface to communicate with other components of your game.

For more information about using the Event Bus (EBus) interface, see Working with the Event Bus (EBus) System.

Play

Runs the default 'play' trigger, if set.

Parameters

None

Return

None

Scriptable

Yes

Stop

Runs the default 'stop' trigger, if set. If no 'stop' trigger is set, kills the default 'play' trigger.

Parameters

None

Return

None

Scriptable

Yes

ExecuteTrigger

Runs the specified audio trigger.

Parameters

triggerName – Name of the audio trigger to run.

Return

None

Scriptable

Yes

KillTrigger

Cancels the specified audio trigger.

Parameters

triggerName – Name of the audio trigger to cancel.

Return

None

Scriptable

Yes

KillTrigger

Cancels all audio triggers that are active on an entity.

Parameters

None

Return

None

Scriptable

Yes

SetMovesWithEntity

Specifies whether triggers should update position as the entity moves.

Parameters

shouldTrackEntity – Boolean indicating whether triggers should track the entity's position.

Return

None

Scriptable

Yes

EBus Response Bus Interface

Use the following response functions with the EBus interface to communicate with other components of your game.

For more information about using the Event Bus (EBus) interface, see Working with the Event Bus (EBus) System.

OnTriggerFinished

Informs all listeners about an audio trigger that has finished playing (the sound has ended).

Parameters

triggerId – ID of trigger that was successfully executed.

Return

None

Scriptable

Yes