In my game I have set a global variable (global.weapon 0;) under the my main control object.
Then when I have set this bit of code for my weapon:
x_offset = global.weaponArray[global.weapon,5];
y_offset = global.weaponArray[global.weapon,6];
my_gun = instance_create(x + x_offset, y + y_offset, obj_gun);
However I receive the following error:
___________________________________________
################################################## ##########################################
FATAL ERROR in
action number 1
of Create Event
for object obj_player:
Push :: Execution Error - Variable Get -5.weapon(100015, -2147483648)
at gml_Object_obj_player_CreateEvent_1 (line 8) - x_offset = global.weaponArray[global.weapon,5];
################################################## ##########################################
How would I be able to fix this?