J
jana
Guest
The global variable that is not set before reading is declared in a persistent object that I place in the room (I only have one room right now). It's declared in the game start event. (I tried the room start event and got the same error.)
This persistent object is the first object on the resource list.
In the room, I checked the instance order and made sure this object is first (I don't know if it matters.).
The code from the object using the variable in its create event:
The error:
Code:
global.orb_speed = 5;
In the room, I checked the instance order and made sure this object is first (I don't know if it matters.).
The code from the object using the variable in its create event:
Code:
motion_set(random(360),global.orb_speed);
What else can I try?############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object obj_orb:
global variable <unknown built-in variable>(-1610512735, -2147483648) not set before reading it.
at gml_Object_obj_orb_CreateEvent_1 (line 4) - motion_set(random(360),global.orb_speed);
############################################################################################