I want to play a “click” sound when a button is pressed in a GUI. I can’t see anything in the documentation that addresses this.
AFAICT the only way to access a sound is by adding it to a game object, right?
Like so:
go
-sound
AFAICT There is NO WAY to add a sound object to a GUI.
The problem is that the gui I want to play the sound in is a gui loaded by the root collection and then overlaid on all proxies loaded. It’s a dialogue box implementation. I do it this way so that I can easily pause the proxy while the dialogue is active, etc.
So, structure is:
main.collection
-#level_proxy
-main_controller
-dialogue_gui
i.e. the sound I want to play in the gui needs to be added to this main.collection as an object like so?
MAIN.collection
-#level_proxy
-main_controller
-dialogue_gui
-sound_go
And then I have the dialogue_gui message the sound_go to play the sound.
This works fine, but I’m worried about constantly having all the .go sounds loaded over all subsequent collections like that… Is there a better implementation of this I’m missing, or is this really the way it’s intended?