Vehicle Body

self:get_parent

Shared

Retrieves the entity the vehicle body 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 vehicle body
local parent = physics.vehicle.create()
local child = physics.vehicle.create()

child:set_parent(parent)

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

On this page