Skip to main content

Checkpoints

Checkpoints are very important, as they let the player to start from a certain point in the level, rather than forcing to restart from start. However, they require a certain configuration in order to work properly and can bre confusing at a first glance. In this page you will learn how to properly set them up.

Setup

note

Here, a big part of the checkpoint settings will be skipped since they are rarely used. Instead, we will focus on the most used and required settings.

As said before in this tutorial, you should have at least 3 rooms with geometry. Place a checkpoint in the enterance of the second room. In the checkpoint component, you will see a lot of stuff, for this tutorial we will need only 2 fields. These are: To Activate and Rooms To Inherit. Here are the explanations of what they do:

  1. To Activate: Any object that is placed in that field will be activated when the checkpoint is hit. This is usually used for activating rooms that were disabled for optimization purpouses(this is what we will use it for), however, you can use it for more advanced level logic.
  2. Rooms To Inherit: Rooms that are placed inside of this field will remain active and will not be reset. Keep this in mind, as this has caused a lot of confusion for new level makers in the past.

Lets place the third room in the To Activate field and Non-Stuff of the first and second rooms in Rooms To Inherit.

caution

For Rooms To Inherit, it is recommended to use only Non-Stuff, as placing the whole room in there will not deactivate enemies that are in these rooms. If your room does not have any enemies inside, it is safe to put the whole room in the field.

Now, when the checkpoint is hit and player dies, it will reset the wave and the room will stay.

TODO: This is misleading, check tundra wiki and fix this shit.

Functionality

checkpoint settings

Here, is a more technical documentation of what Checkpoints are capable of doing.

  • Force Off
    • Forcefully turns the checkpoint off.
    • Ideal to use this over just deactivating the checkpoint, as it can break checkpoints otherwise if 2 reset the same object.
    • Use the SetForceOff() event to turn this on/off on runtime.
  • Rooms
    • List of objects to be reset on the level being loaded.
  • Rooms To Inherit
    • List of objects to be reset on the checkpoint being hit.
tip

Wrong placement of an object between Rooms and Rooms To Inherit is an easy way to cause a Sequence Break in a level, where you can trigger certain events under conditions that aren't intended. Think about what you're resetting and how it can be abused by passing through the checkpoint at the wrong time(or not at all).

caution

References to objects in Rooms and Rooms To Inherit will break because the checkpoint activates clones of them on runtime. The Arena Status script can solve issues between static/nonstuff -> gorezone.

  • Doors To Unlock
    • List of objects with Door script to be unlocked on respawn.
  • Multi Use
    • Regenerates the checkpoint after going through it (Use the CheckpointReusable prefab).
  • Dont Auto Reset
    • Prevents the checkpoint from immediately activating(in cases where you'd want to call the ResetRoom() and InheritRoom() events manually).
  • Start Off
    • Checkpoint object is deactivated on scene load.
  • Unteleportable
    • Removes checkpoint from list of checkpoints to teleport to in the cheats menu.
  • Invisible
    • Hides checkpoint graphic.
    • Can be toggled on runtime with SetForceOff() event.
  • On Restart()
    • List of UnityEvents to be called when the player respawns.
caution

Checkpoints can only be parented to empty objects at 0,0,0 position.

Pitfalls

Checkpoints can break if they dont have the following:

  • Object in `To Activate:
    • There must be a gorezone on your object.
  • Object in Rooms OR Rooms to Inherit:
    • There must be gorezones on each of your objects in Rooms or Rooms to Inherit.
    • Objects cannot contain other checkpoints in them.
warning

In some cases, having static flags on an object that gets reset can cause issues with the checkpoint. Generally, if an object has static flags, it shouldn't be changing and need to be reset in the first place.