Checkpoint System with PlayerStart object - Always respawning at the wrong checkpoint

Hey folks I’m trying to create a checkpoint system for a platforming game. The pieces that I have are

  • A checkpoint trigger box, when the player overlaps with it it sends info to GameMode to store its location

  • On gamemode I have a custom script on FindPlayerStart - It checks if a checkpoint is active and, if it isn’t, just calls the parent function, if it is it finds a new checkpoint,

  • On the PlayerCharacter blueprint, on OnDestroyed, I call FindPlayerStart and RestartPlayerAtPlayerStart with the new checkpoint,

The problem is that I’m not respawning on the new checkpoint. I’m always respawning on the old one (which is the first one I placed in the level). I’m not really sure what I’m doing wrong but here are some questions

  • Are FindPLayerStart and ChosePlayerStart only called at the start of the game?
  • I tried storing some info on a custom GameState that I made, but then my controller simply didn’t possess my pawn. I’m inheriting from the base GameState (which works fine) but I’m not sure where to hook up the controller to the pawn
  • It is a single player game, so I won’t have multiple players in the same session

Thank you very much folks!

HI @gabriellcarpes ,
You can try doing something like this

BP_GameMode

BP_CheckPoint


BP_PlayerCharacter

Let me know if it worked for you!

@BRGEzedeRocco Hello,

I found this topic, while I am trying to create a checkpoint and respawn system myself, while I am pretty new to this. Initially I created it with interfaces and it worked perfectly, but my whole respawn logic lived in the character BP. Now my dear chat GPT, told me that I should use event dispatchers and move the logic to the game mode, while checkpoint only validates my last position (if I passed over it). There are several issues though. 1. I used Set actor transform and it scales my character after I die ( I spawn on the checkpoint location though which is a good sign). 2. if I die on my first trap, I do not die practically and I can keep on moving, no repsawn no nothing. My question, since I cannot provide the Blueprints right now is, is it possible to use dispatchers on the above code you provided?

Hello @Alexs-GR7 ,

Yes, you can use Event Dispatchers for this case, but before applying them it’s worth asking whether they are really necessary and if it makes sense to use them instead of a direct logic approach.
Event Dispatchers are not mandatory nor an automatic “best practice”; they are simply a tool that makes sense only in certain scenarios.

Here is the documentation, where it is clearly explained when each communication method should be used and when an Event Dispatcher can be useful:

Regarding the issues you mentioned, without seeing the Blueprints it’s hard to be certain, but at first glance they could be coming from the following:

The scaling issue can happen when using SetActorTransform. That node applies location, rotation, and scale, so if the checkpoint’s transform does not have a proper scale, it can cause conflicts and end up scaling the character when respawning.

The second issue seems to indicate that, when you step on the trap for the first time, the Character is not actually being destroyed or the full death/respawn flow is not being executed. Because of that, you still keep control and the respawn is never triggered.
For these cases, I would recommend selecting the node and pressing F9, which adds a breakpoint and helps verify whether the logic is being called correctly.

To really identify what is failing in your setup, it would be necessary to see how the full death and respawn logic is implemented in your Blueprints.

Hope it helps!

2 Likes

@BRGEzedeRocco Thank you very much for your time and effort, i really appreciate it!!!

I saw a video where he used Spawn Actor from class or something like that, and the code was almost identical with mine, with the only difference being he destroyed the actor and possesed him again in the end. That helped at least with the scaling issue.

I think though that you might be right about the dipatcher, it is probably too much.

How To Setup Multiple Checkpoints And Respawn At Them - Unreal Engine 5 Tutorial

This is the video in case it helps someone else who stumbles upon the same issue.

Thank you very much again!

1 Like