self:set_looped
Client
Sets whether the audio-2d instance loops playback
Syntax
local status = self:set_looped(
state
)Parameters
| Type | Name | Description |
|---|---|---|
bool | state | Determines the looping behavior of playback: • When true - the stream restarts automatically once it reaches the end• When false - the stream stops once it reaches the end |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.audio_2d.create("sounds/ambient.ogg")
entity:set_looped(true)
entity:play()