• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Global.var

  • Thread starter Andreas Landertshammer
  • Start date
A

Andreas Landertshammer

Guest
Why isn´t this working? (See picture)
This are 2 objects and if i implemet the code on the 2nd object the following error comes up:


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_wolken_contr:

Push :: Execution Error - Variable Get -5.bgspeed(100000, -2147483648)
at gml_Object_obj_wolken_contr_StepNormalEvent_1 (line 1) - y += global.bgspeed
############################################################################################
 

Attachments

NightFrost

Member
The instance on the right is probably running first, so the global is not yet defined at the time. You should define all global variables before you allow any references to them to take place. For example, an init room that runs first and has one object that defines game's global variables.
 
A

Andreas Landertshammer

Guest
The instance on the right is probably running first, so the global is not yet defined at the time. You should define all global variables before you allow any references to them to take place. For example, an init room that runs first and has one object that defines game's global variables.
Thanks! helped!!
 
Top