[Solved] Checkpoint Error

Hello dear ppl. I have some error and I cant debug it. This checkpoint system is just not working. I go to checkpoint, it changes color so its active and as soon as i hit that black moving platform it just restart level no respawn at checkpoint… Any suggestions?

A few of things:

  1. You never change Colour of player_lvl1 back to 0. It’s set in event 2 of Black_movingtile_death, but that’s it.

  2. If you set the CheckX and CheckY to the player X and Y positions when you hit a check point, you won’t need to fiddle with the Y position adjustment in the last line of the screen shot.

  3. If the game is reloading the level, then there’s a condition when you reset your scene that’s causing it to fire. Show us the code around any scene change events you have.

1 Like

Wow thanks for quick reply! Anyway 1. and 2. statement you mention is not important (its just some game mechanics) but yes I can sort it out that way. 3. Is true but I can’t find whats a mistake. Look at beginning of the scene… PS Dont read comments, thats for upward camera movement, I changed it to go down. :wink:

Could try doing Trigger Once on the condition “The variable Colour of Player = 1” otherwise the animation could be looping and never actually “finishing”. Then the “Player animation finished” sub-event wouldn’t be triggered. Worth a try I guess.

1 Like

Thanks for reply my friends. I solved it. It is problem in variable Colour. In other instance where player is in colission with other tile Colour is set to 0 and 1, and for this I changed it to 0 and 2. And it works! Thanks guys anyway, this is very good community of many kind people!

I think gdevelop has some bugs. I am on win7 64bit.
I have to exact same prob.as above and it cannot be solved changing the value of object variable, even making new object variable its not working. It is working for black color tile, but cannot work for white color tile with exact same code with of course modified animation… If anyone interested I can see picture for what I mean…

Try doing Trigger once on the animation conditions. It might be getting stuck on one animation (or stuck on one of the variables that switch the animations) and so not switching to the other anim.

If that doesn’t work, I’m not sure if it’s applicable to your game but you might need to add a condition “not in collision with Black_moving” and “not in collision with White_moving” (invert conditions) on the same events where you have the collisions with white and black.

1 Like

Thanks for reply. I tried to add trigger one to animations and in collision events. Doesn’t work. Also tried inverted conditions doesnt work. I really don’t see whats the prob. Even some strange events happend, like one tile does one job and other tile does different, but its the same object, very strange, and I am almost sure that its some bug within software…or gdevelop just cant handle multiple variables that does different job within same objects…

I managed this issue somehow. It was the problem with moving camera. I dont know if its a bug, but when I add more pixels to respawn to checkpoint like checkpoint.y() - 2500, that seems to work. Thanks guys.