self:is_type

Shared

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 whether an instance matches a given type
local entity = core.model.create("character")

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

On this page