• 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!

End Step does not assign value (solved)

M

Misty

Guest
I'm stumped

So, my code is like

if collision_point()>0
{
audio_play()
}
else
{
myVar=3 instance_create(100,100,debug)
}

if myVar==3 instance_create(120,100,debug)

And I run the game at 1 fps, and the debugs are not being created at the same time, but one after the other. I tried this in GMS2 also.
 
Last edited:

curato

Member
Is this supposed to be an if statement?
Code:
myVar=3 instance_create(100,100,debug)
I am not wrapping my head around what should be happening here or the representing step and end step and the myVar is different in each event?
if those are both indeed if statements then if would help to see the code where myVar is changing since that seems to be the key if I am understanding correctly.
 
M

Misty

Guest
Is this supposed to be an if statement?
Code:
myVar=3 instance_create(100,100,debug)
I am not wrapping my head around what should be happening here or the representing step and end step and the myVar is different in each event?
if those are both indeed if statements then if would help to see the code where myVar is changing since that seems to be the key if I am understanding correctly.
All of the code occurs in the same codeblock. The code checks if a collision occurs, if not, sets the myVar to 3.

Then, according to me, the code should then create a 2nd instance, after checking if myVar is 3. But instead, it does not recognize myVar has been set to 3 until the next frame, so the 2nd debug draw has a delay. It behaves as if some kind of break statement was put in the code, but I quadruple checked my code many times and there is no break statement or anything.
 
Top