self:set_max_volume

Client

Sets the maximum linear volume ceiling of the audio-3d instance


Syntax

local status = self:set_max_volume(
    value
)

Parameters

TypeNameDescription
floatvalueMaximum linear volume ceiling to apply, where 1.0 is the source's natural full-volume level
Clamps the volume so it never exceeds this level regardless of distance

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Cap the output level of an audio-3d instance
local entity = core.audio_3d.create("sounds/ambient.ogg")

entity:set_max_volume(1.5)

On this page