How to stop character teleporting to checkpoint if it is not activated yet

Hello, I created a respawn system that works great. The only problem is that when the player spawns in the level, it can just press the checkpoint button to teleport to the checkpoint. How do I fix this?

This is my player blueprint:

This is also in my player blueprint on how I set the current checkpoint:

I tried to print the current checkpoint in the event tick but this showed me nothing but when I press the “Respawn” button it just teleports there and than starts printing the current checkpoint

Hi @ImAboveTheLaw

Not sure i am understanding your logic here, but the respawn seems to be sending you to a check point that is the last in the loop you scan? what is the purpose of checking the checkpoints on respawn?

Easiest way is put a variable in your player blueprint called “Current Checkpoint”, each time you overlap a check point store it in your player. Then deactivate it (you dont need to list them all you know which checkpoint you are at by the overlap actor!)

When you respawn get the location of the “Current Checkpoint” which will be the last one.

you can also use this variable to print out the current checkpoint for debugging.

So on overlap set the current checkpoint to the overlap checkpoint, and then deavtivate it to stop it being re triggered (i guess thats what you want)

if by player clicks the checkpoint button what is this buttons purpose and when is it allowed?

Hello @High500 That is Exactly what I am doing and that is working the only problem is that when you have not passed a checkpoint yet you can still pres the respawn button and it will teleport you to the first checkpoint in the level.

ok so at begin play make sure the checkpoint is not set
then on your checkpoint button use “Is Valid?” node to check if it has a valid checkpoint. if so warp to it, if not do nothing

1 Like

image
How to make it not set?

yup thats fine. it will now be “Not Valid” or “None” or “Nothing”

Thank you; this did the trick!

1 Like

you are welcome! good luck!

1 Like