self:set_looped

Client

Sets whether the audio-3d instance loops playback


Syntax

local status = self:set_looped(
    state
)

Parameters

TypeNameDescription
boolstateDetermines 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

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Loop an ambient audio-3d instance
local entity = core.audio_3d.create("sounds/ambient.ogg")

entity:set_looped(true)
entity:play()

On this page