Yuari
Documentation
Docs/Debug/debug.getmetatable

debug.getmetatable

Returns the raw metatable of an object without invoking Lua protection rules.

Syntax

debug.getmetatable(object: any) -> table

Parameters

ParameterTypeDescription
objectanyThe object value used by the call.

Returns

TypeDescription
tableThe raw metatable of an object without invoking Lua protection rules

Description

debug.getmetatable is part of the Debug library. The debug library exposes the internals of the active Luau state, including protos, constants, upvalues and stack frames.

The call is read-only: it resolves the current value when invoked and does not change the underlying state.

The aliases getmetatable(object) resolve to the same implementation.

Example

print(debug.getmetatable(workspace))

Notes

  • Aliases: getmetatable(object).
  • Writing protos, constants or upvalues can corrupt a running function; test changes carefully.