• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GML Other checkpoints disappear when I collide with specific one



When I touch obj_checkpoint it is set to change its sprite when it's activated (collide with player). But when the checkpoint I collided with changes its sprite, the other checkpoints disappear.

The reasoning behind this code I got from this video by Shaun Spalding.

I'm not sure what the problem is? I feel like I might not be indicating what should happen to other checkpoint instances when I collide with specific one? I'm not very experienced with coding yet so I apologize if this is a silly question.

Any help would seriously be appreciated! This is for a game jam that ends in four days!

These are my global room variables, which I initialize in a separate room at beginning of game:

global.checkpoint = noone;
global.checkpointR = 0;
global.checkpointx = 0;
global.checkpointy = 0;


Here's the code in obj_checkpoint step event:

if (place_meeting(x,y,Ninja)) {

global.checkpoint = id;
global.checkpointR = TrueLevel;
global.checkpointx = x;
global.checkpointy = y;


if global.checkpointR = TrueLevel
   if (global.checkpoint == id) 
       sprite_index = spike_fall;


sprite_index = obj_checkpoint;