Parser Error: Identifier not found: Global

godot

#1

I’ve been getting this kind of an odd “bug” or error on my Navigation2D script, even though I did everything exactly in the video and the spellings of the variables correctly.

EDIT : The error doesn’t just appear on the Navigation2D, but on whichever of the three (Nav2D, Guards, Player) that is nearer to the very top of the scene tree that gets the error when assigned the nodes to the global variables.

From the error log, I got this error message :

0:00:00:0581 - Condition ' _debug_parse_err_line >= 0 ' is true. returned: __null Description: Time: 0:00:00:0581 C Error: Condition ' _debug_parse_err_line >= 0 ' is true. returned: __null C Source: modules/gdscript/gdscript_editor.cpp:287 C Function: debug_get_stack_level_instance

Actions done:

  1. Rename/double check variable names of variables inside Global.gd

  2. Remove and Reattach new script to Navigation2D

  3. Delete and recreate Global.gd script

so far, none of these worked.

My Navigation2D script :

extends Navigation2D

func _ready():
	Global.navigation = self

My Global.gd script :

extends Node

var Player
var navigation
var destinations