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
| Type | Name | Description |
|---|---|---|
float | result | Current maximum audible distance in pixels between the audio instance and currently active camera |
Examples
local entity = core.audio_2d.create("sounds/ambient.ogg")
core.engine.print("info", "Max distance:", entity:get_max_distance())