self:is_looped

Client

Checks whether the audio-2d instance is set to loop playback


Syntax

local result = self:is_looped()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
boolresulttrue if playback loops once it reaches the end, false otherwise

Examples

Check if an audio-2d instance is looping
local entity = core.audio_2d.create("sounds/ambient.ogg")

entity:set_looped(true)

if entity:is_looped() then
    core.engine.print("info", "This sound will loop")
end

On this page