self:get_max_distance

Client

Retrieves the maximum distance at which the audio-2d instance can be heard


Syntax

local result = self:get_max_distance()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
floatresultCurrent maximum audible distance in pixels between the audio instance and currently active camera

Examples

Get the max distance of an audio-2d instance
local entity = core.audio_2d.create("sounds/ambient.ogg")

core.engine.print("info", "Max distance:", entity:get_max_distance())

On this page