self:play

Client

Starts playback of the audio-2d instance


Syntax

local status = self:play(
    position = 0.0
)

Parameters

TypeNameDescription
floatpositionPosition in seconds to start playback from

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Play an audio-2d instance from the beginning
local entity = core.audio_2d.create("sounds/ambient.ogg")

entity:play()
Play an audio-2d instance from a specific position
local entity = core.audio_2d.create("sounds/ambient.ogg")

entity:play(5.0)

On this page