self:is_type

Client

Checks whether the instance belongs to the specified type


Syntax

local result = self:is_type(
    name
)

Parameters

TypeNameDescription
stringnameType to check against

Returns

TypeNameDescription
boolresulttrue if the instance matches the given type, false otherwise

Examples

Check the type of a collision shape instance
local body = physics.rigid.create()
local entity = physics.collision_shape.create(body)

core.engine.print("info", entity:is_type("physics.collision_shape")) -- true
core.engine.print("info", entity:is_type("model"))  -- false

On this page