Simple Checkpoint Issues

Hello,
I am having trouble setting up a checkpoint similar to the one in the example games. The player only spawns where I want it to sometimes but other times it spawns at the top of the map and the checkpoint immediately turns green without me doing anything. I am not sure why this is happening but if someone wants to take a look that would be appreciated.

Thanks

Game Link

2 Likes

Here is your problem, the position block is at 5 pixels not 5 blocks.


However, I don’t really like this system, it means you have to manually set respawn for each other the checkpoints. If you want it to just save automaticly, then use this code:

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":0,"name":"Checkpoint","behaviorType":"logic.NodeGroup","x":-720,"y":-136,"group":"","id":"2a5cf6132497ba49","isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":-540,"y":0,"group":"2a5cf6132497ba49","id":"255c6d4c29d47e4e","resetOnLevelStart":false},{"inputCount":2,"outputCount":1,"name":"Save Number","behaviorType":"logic.logic.Storage","x":-360,"y":-72,"group":"2a5cf6132497ba49","id":"255cc123d225c441","storageKey":"Checkpoint X","dataType":2},{"inputCount":2,"outputCount":1,"name":"Save Number","behaviorType":"logic.logic.Storage","x":-360,"y":24,"group":"2a5cf6132497ba49","id":"2a5a137aefcfd24d","storageKey":"Checkpoint Y","dataType":2},{"inputCount":4,"outputCount":2,"name":"Position","behaviorType":"logic.properties.Position","x":-180,"y":0,"group":"2a5cf6132497ba49","id":"2a5a72f04573f143","pixelUnits":true,"resetVelocity":false},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":-360,"y":200,"group":"2a5cf6132497ba49","id":"2a5adf822c67a644","targetId":0,"prop":"x","version":2},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":-360,"y":304,"group":"2a5cf6132497ba49","id":"2a5ae54edd794f48","targetId":0,"prop":"y","version":2},{"inputCount":2,"outputCount":1,"name":"Save Number","behaviorType":"logic.logic.Storage","x":-180,"y":176,"group":"2a5cf6132497ba49","id":"2a5b35db22f6fe47","storageKey":"Checkpoint X","dataType":2},{"inputCount":2,"outputCount":1,"name":"Save Number","behaviorType":"logic.logic.Storage","x":-180,"y":312,"group":"2a5cf6132497ba49","id":"2a5b3680a2d8974b","storageKey":"Checkpoint Y","dataType":2},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":-900,"y":256,"group":"2a5cf6132497ba49","id":"2a5c3520e8b56547"},{"inputCount":2,"outputCount":3,"name":"Proximity","behaviorType":"logic.components.Prox2","x":-720,"y":240,"group":"2a5cf6132497ba49","id":"2a5c44acd8626d42","targetEntityId":0,"threshold":10,"targetClassId":17582767,"nearestOnly":false,"firstObject":true,"allObjects":false,"contains":false,"shape":0,"oX":0,"oY":0,"pin":false},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":-540,"y":240,"group":"2a5cf6132497ba49","id":"2a5c84e3c6b61645","_startVal":0,"dataType":2}],"links":[{"input_id":"255cc123d225c441i1","output_id":"255c6d4c29d47e4eo0"},{"input_id":"2a5a137aefcfd24di1","output_id":"255c6d4c29d47e4eo0"},{"input_id":"2a5a72f04573f143i0","output_id":"255cc123d225c441o0"},{"input_id":"2a5a72f04573f143i1","output_id":"2a5a137aefcfd24do0"},{"input_id":"2a5b35db22f6fe47i0","output_id":"2a5adf822c67a644o0"},{"input_id":"2a5b3680a2d8974bi0","output_id":"2a5ae54edd794f48o0"},{"input_id":"2a5c44acd8626d42i1","output_id":"2a5c3520e8b56547o0"},{"input_id":"2a5c84e3c6b61645i2","output_id":"2a5c44acd8626d42o0"},{"input_id":"2a5c84e3c6b61645i1","output_id":"2a5c44acd8626d42o2"},{"input_id":"2a5adf822c67a644i0","output_id":"2a5c84e3c6b61645o0"},{"input_id":"2a5c84e3c6b61645i0","output_id":"2a5c84e3c6b61645o0"},{"input_id":"2a5ae54edd794f48i0","output_id":"2a5c84e3c6b61645o0"}]}}}

Delete the code you had for checkpoint in the player object and replace it with the code above. Now you can have multiple checkpoints without presetting the respawn point for each one.

Wow, that seemed aggressive

lol I just use capitals because I don’t want to bold it, takes more time lol
But I guess if it sounds like that

2 Likes

Thanks for the help! Although it seems to work now my player only spawns on the flag and I am not sure why?

1 Like

What do you mean? What is the problem with the player only spawning at the checkpoint?

that’s because i used saves, it allows you to save progress even when you reload. Do you not want this?

1 Like

Thats fine I guess but when there are multiple flags it turns all of them green and I still spawn at the very top sometimes. Thanks for your help!