Lua check for bool true
Posted: Tue Jul 09, 2024 1:16 pm
Hello Tony
I have a public bool called radioFound which starts out as false.
Then after it becomes TRUE, I want to use Lua to check in the node tree that if this condition is true then start this node, but it never evaluates to true..
In the node Condition box I use this to check " setHasRadio = true"
I have a public bool called radioFound which starts out as false.
Then after it becomes TRUE, I want to use Lua to check in the node tree that if this condition is true then start this node, but it never evaluates to true..
In the node Condition box I use this to check " setHasRadio = true"
Code: Select all
public bool radioFound = false;
private void Awake()
{
Lua.RegisterFunction(nameof(setHasRadio), this, SymbolExtensions.GetMethodInfo(() => setHasRadio()));
}
bool setHasRadio() { return radioFound; }