self:set_fx_enabled

Client

Enables or disables an audio effect on the audio-3d instance's effect chain


Syntax

local status = self:set_fx_enabled(
    name,
    state
)

Parameters

TypeNameDescription
stringnameName of the effect to toggle
boolstateDetermines the enabled state of the effect:
• When true - the effect is applied to the signal
• When false - the effect is bypassed

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Toggle an effect on an audio-3d instance
local entity = core.audio_3d.create("sounds/ambient.ogg")

entity:add_fx("my_reverb", "reverb", { wet = 0.5 })

-- Bypass
entity:set_fx_enabled("my_reverb", false)

-- Re-enable
entity:set_fx_enabled("my_reverb", true)

On this page