self:play
Client
Starts playback of the audio-2d instance
Syntax
local status = self:play(
position = 0.0
)Parameters
| Type | Name | Description |
|---|---|---|
float | position | Position in seconds to start playback from |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.audio_2d.create("sounds/ambient.ogg")
entity:play()local entity = core.audio_2d.create("sounds/ambient.ogg")
entity:play(5.0)