The director command allows you to execute a function that includes interruptions without halting rendering of the world or the execution of other code within your script. The function is run as a parallel thread to the rest of the script's activity. If you quit the world before this function is executed, Vizard will force them to quit and warn you that it did so. Director functions are useful for performing IO operations that would otherwise halt the rendering of the world or the execution of other code (e.g. reading data from a large file, downloading a file from the Internet)
Note: The director command creates an asynchronous thread and can cause unexpected results if not used correctly. In almost all cases, tasks should be used instead.
In the following example a director function is used to perform a file operation. A task is used to call the director function and wait for it's return: