self:set_volume
Client
Sets the linear volume of the audio-2d instance
Syntax
local status = self:set_volume(
volume
)Parameters
| Type | Name | Description |
|---|---|---|
float | volume | Linear volume to apply - where 0.0 is silent and 1.0 is full volumeValues above 1.0 amplify the audio beyond its original level |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.audio_2d.create("sounds/ambient.ogg")
entity:set_volume(0.5)