Audio 3D

self:get_parent

Client

Retrieves the entity the audio-3d instance is currently parented to

Syntax

local parent = self:get_parent()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
entity | boolparentParent entity instance, false if the instance has no parent

Examples

Get the parent of a audio-3d instance
local parent = core.audio_3d.create("sounds/ambient.ogg")
local child = core.audio_3d.create("sounds/ambient.ogg")

child:set_parent(parent)

core.engine.print("info", child:get_parent() == parent) -- true
core.engine.print("info", parent:get_parent()) -- false

On this page