Author Topic: Game maker problem  (Read 1152 times)

QuentinJanuel

  • Wannabe
  • Posts: 11
  • Fangames are love, you are life! <3
  • OS:
  • Windows 8.1/Server 2012 Windows 8.1/Server 2012
  • Browser:
  • Chrome 48.0.2564.116 Chrome 48.0.2564.116
    • View Profile
    • Stream
  • Playstyle: Keyboard
Game maker problem
« on: February 27, 2016, 08:32:40 AM »
Hey, I have a problem when I make a new object in game maker.
If I write : "a=instance_create(x,y,object2);a.mode=2" for example.
Then in the create event of the object 2 I wrote that :
if(mode==2){//do something}
and game maker returns me an error "unknown variable 'mode' "
probably because game maker checks the variable mode before to assign when it creates the object2 but idk...
What could I do? (I DON'T WANNA USE ALARMS!)

QuentinJanuel

  • Wannabe
  • Posts: 11
  • Fangames are love, you are life! <3
  • OS:
  • Windows 8.1/Server 2012 Windows 8.1/Server 2012
  • Browser:
  • Chrome 48.0.2564.116 Chrome 48.0.2564.116
    • View Profile
    • Stream
  • Playstyle: Keyboard
Re: Game maker problem
« Reply #1 on: February 27, 2016, 09:17:44 AM »
No nevermind sorry, I fixed it myself :
mode = 2;
instance_create(x,y,object2);

create event of object2 :
mode = object1.mode
if(mode == 2){
//do something
}