Get/set metatable in GDScript #111
-
|
Hi, I'm wondering how I set a metatable for a Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Right now there's no mechanism for that in GDScript. We should totally implement it! What you can do for now is open the var lua = LuaState.new()
lua.open_libraries()
var some_table = lua.create_table()
var metatable = lua.globals.getmetatable.invoke(some_table)
assert(metatable == null)
lua.globals.setmetatable.invoke(some_table, some_table)
metatable = lua.globals.getmetatable.invoke(some_table)
assert(metatable == some_table) |
Beta Was this translation helpful? Give feedback.
-
|
Just created Issue #112 to track the metatable feature request. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @OvercookedBeef, so I implemented |
Beta Was this translation helpful? Give feedback.
Hey @OvercookedBeef, so I implemented
LuaTable.get_metatableandLuaTable.set_metatablemethods that can be called from GDScript, you can download the newly released version 0.5.0 to use these new methods!Cheers \o/