Develop
Develop
Select your platform

Pointer Event Audio Player

Updated: Nov 13, 2024

What is a Pointer Event Audio Player

The IsdkPointerEventAudioPlayer provides functionality for playing sounds in response to the various states of an interaction. You can play sounds for hover, unhover, select, unselect, etc. without the need to manually set up all of the logic to handle those events and play the sounds.

How do Pointer Event Audio Players work?

The IsdkPointerEventAudioPlayer references the interactable component, Pointable, in an interactable object and registers itself to receive broadcasts of interaction events for that interactable component. When an interactor interacts with the interactable, the IsdkPointerEventAudioPlayer receives a notification and plays the sound corresponding to the new state of the interactable.

Pointable

The Pointable, or interactable component, for the audio player to listen for interaction events on is set using the SetPointable() function. In general, you will set this at BeginPlay, but it can be set at any time during play depending on your use case.
Set Pointable for Pointer Event Audio Player

Audio Sources

The IsdkPointerEventAudioPlayer uses AudioComponents to determine the sounds to play.
Audio ComponentDescription
HoverAudio
Sound to play when the interactable goes from being unhovered to hovered.
UnhoverAudio
Sound to play when the interactable goes from being hovered to unhovered.
SelectAudio
Sound to play when the interactable goes from being hovered to selected.
UnselectAudio
Sound to play when the interactable goes from being selected to hovered.
MoveAudio
Sound to play when the interactor moves while the interactable is either hovered or selected.
CancelAudio
Sound to play when the interaction is canceled while the interactable is either hovered or selected.
To configure the sounds to play for an interactable object, you must add an AudioComponent to the interactable object for each state you want to play a sound for. Use the Set*Audio() functions to assign the AudioComponents to the IsdkPointerEventAudioPlayer during BeginPlay.
Set Audio Components for Pointer Event Audio Player

Learn more

Now that you know how to play sounds with Interaction SDK, continue on to the following guides:
Did you find this page helpful?