model.getGlobalVariable(index, flight_mode)
-- get GV3 (index = 2) from Flight mode 0 (FM0)
val = model.getGlobalVariable(2, 0)Parameters
Return value
Notice
Last updated
Was this helpful?
Return current global variable value
Example:
-- get GV3 (index = 2) from Flight mode 0 (FM0)
val = model.getGlobalVariable(2, 0)index zero based global variable index, use 0 for GV1, 8 for GV9
flight_mode Flight mode number (0 = FM0, 8 = FM8)
nil requested global variable does not exist
number current value of global variable
a simple warning or notice
Last updated
Was this helpful?
Was this helpful?