Upon attempting the solution mentioned above no errors were produced on compilation, although it produced the following warning:
The local variable 'mob' is shadowing an already-defined variable at line 3.
And upon running the compiled game, the following error is produced:
Invalid call. Nonexistent function 'instance' in base 'PathFollow2D'.
which points to the line
var m = mob.instance()