self:set_pitch_scale

Client

Sets the pitch scale of the audio-2d instance


Syntax

local status = self:set_pitch_scale(
    pitch_scale
)

Parameters

TypeNameDescription
floatpitch_scalePitch multiplier to apply
1.0 is normal pitch, 2.0 doubles it, and higher or lower values scale accordingly

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Set a higher pitch on an audio-2d instance
local entity = core.audio_2d.create("sounds/sfx.ogg")

entity:set_pitch_scale(1.5)

On this page