You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a LuaFunction where in I will call the invoke() method and pass in some var-args. I wish to pass some data to this LuaFunction such that it can be referenced by the lua code as if it was a built-in variable.
For example, I want to have a variable named "script". When a script class executes its lua code, and it references the "script" value, I want it to represent that script object, but only for that lua code--I want no other lua code to be able to see this variable.
I created a stackoverflow question here:
https://stackoverflow.com/questions/72307489/luaj-set-variable-in-luafunction-without-using-globals
I have a LuaFunction where in I will call the invoke() method and pass in some var-args. I wish to pass some data to this LuaFunction such that it can be referenced by the lua code as if it was a built-in variable.
For example, I want to have a variable named "script". When a script class executes its lua code, and it references the "script" value, I want it to represent that script object, but only for that lua code--I want no other lua code to be able to see this variable.
Currently, I am using Globals via:
Lua code:
While this does work, I can reference "script" in my lua code, this also sets _G.script, which I do not like.
Does anyone have any ideas for this situation?
The text was updated successfully, but these errors were encountered: