Global Script
The Global Script node allows you to define functions, data structures and variables that then can be accessed from any script node. There are no limits on how many global script nodes can be added - they all combine into a single global script.
The global script is effectively included before each one of the script nodes, and as such, any local variables assigned using let
or var
keywords can be overridden in individual script nodes. Because of this, it is good practice to use the const
keyword instead in the global script. This defines the variable as a 'constant' that cannot change, but the value can be used later on in any operation. Keywords and strings are highlighted when applied correctly.