self:set_fx_enabled
Client
Enables or disables an audio effect on the audio-2d instance's effect chain
Syntax
local status = self:set_fx_enabled(
name,
state
)Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of the effect to toggle |
bool | state | Determines the enabled state of the effect: • When true - the effect is applied to the signal• When false - the effect is bypassed |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.audio_2d.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)