Model
self:get_parent
SharedRetrieves the entity the model is currently parented to
Syntax
local parent = self:get_parent()Parameters
| No parameters are accepted by this function |
|---|
Returns
| Type | Name | Description |
|---|---|---|
entity | bool | parent | Parent entity instance, false if the instance has no parent |
Examples
core.model.load("character", "models/character.glb")
local parent = core.model.create("character")
local child = core.model.create("character")
child:set_parent(parent)
core.engine.print("info", child:get_parent() == parent) -- true
core.engine.print("info", parent:get_parent()) -- false