Blueprints: Checkpoints and Kill-Zones


With this update, checkpoints and kill-zones have been added! What exciting news! Let us take a deep dive into the code, and how it all works.

BLUEPRINT: Checkpoint

This one is super simple. After the player touches the checkpoint, the custom event "Save Checkpoint" is called, which saves the players location at the checkpoint.  

BLUEPRINT: Third Person Character 


While not in the checkpoint event graph, this stuff is basically what makes them work. Upon starting the game, the save checkpoint custom event is automatically called to make sure the character respawns if they die before hitting a checkpoint. The next code makes the Save Checkpoint event work by setting all of the proper transforms so that the player respawns where they should respawn.


This code allows the player to respawn. After dying, the player's game will become uncontrollable, and the camera will begin to fade. 

After the fade starts, the proper transforms from before are called upon and the "You Died" screen plays out. After a couple of seconds, the screen disappears and the camera begins to fade in from black. Once it is fully faded in, then the player is able to play the game again at the proper checkpoint.

BLUEPRINT: Kill-Zone

Another simple one. Once the player hits the kill-zone, the load checkpoint event from before is called, respawning them at their last checkpoint.

Files

May 12 Build 548 MB
54 days ago

Get Coding-One

Leave a comment

Log in with itch.io to leave a comment.