Audio
Play sounds or music on objects.
Introduction
Audio plays sound effects or background music, and it supports 3D spatial sound that fades naturally as players walk away. From a humming fridge to a full soundtrack, it all runs through here. The Audio component panel in the Uni editor Image The Audio component panel in the Object editor. caption
How to Access
Select an object, open the Properties Panel, then press the Add Component button at the bottom and pick Audio. The component stacks onto the object as a new accordion of properties. How to Access - Add Component in the Properties Panel
Another Way to Access
Shortcut: open the Asset Panel, go to the Device tab, Basic category, and click the Audio block. The editor spawns a cube with Audio already attached, ready to adjust. How to Access - the Audio block in Asset Panel > Device > Basic
Properties
Is Active Bool Turns the component on or off. Audio The sound asset to play. Volume Int How loud the sound plays, from 0 to 100. Auto Play Starts playing the moment the game begins. Loop Plays over and over without stopping. Spatial Turns on 3D audio, so the sound comes from the object’s position instead of playing globally. Min Distance Float Inside this radius the sound stays at full volume, no falloff. Max Distance Beyond this radius the sound goes completely silent. Property Type Description Every property on the Audio component.
Events
Audio has no events.
Commands
Play Plays the assigned audio from the beginning. None Pause Pauses the audio where it is. Unpause Resumes audio that was paused. Stop Stops the audio completely. Play One Shot Fires off a custom sound effect once, perfect for explosions and coin pickups. 1. Audio: the sound to play, 2. Volume: how loud Command Description Parameter Commands that drive the component from a script.
Example
Audio attached to an object Audio - Simple video