I am trying to get a property of a userdata object. Similair to getattr
in many other languages.
Say for variable obj
which is a userdata object I want to get a property, but that property is in a variable someVar
. Meaning I can't use obj[someVar]
I'd have to use something like getattr(obj, someVar)
.
Is there a way to do this in Lua?