R
Remix The Idiot
Guest
I need help, I wanna have an object get a variable that has increasing value for every object in the room.
for example I want my object called obj_object with his variable called "id", so there is 3 of them in a room, the first obj_object will have 1 as its "id" variable and the 2nd will have 2 and the 3rd a 3.
At first I thought it was simple, just put a create code that says this: "obj_object.id+1" but all it did was make the first of that object have 1 and everything else a 2. I know why this is what happens when I do it, but I just don't know the correct fix as there may be a function or something that I don't know yet that can easily maybe fix this.
I'm new to GML and has only had a little experience with coding in general so far, and helping me with this would be greatly appreciated for a novice.
Thanks in advance!
for example I want my object called obj_object with his variable called "id", so there is 3 of them in a room, the first obj_object will have 1 as its "id" variable and the 2nd will have 2 and the 3rd a 3.
At first I thought it was simple, just put a create code that says this: "obj_object.id+1" but all it did was make the first of that object have 1 and everything else a 2. I know why this is what happens when I do it, but I just don't know the correct fix as there may be a function or something that I don't know yet that can easily maybe fix this.
I'm new to GML and has only had a little experience with coding in general so far, and helping me with this would be greatly appreciated for a novice.
Thanks in advance!